Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Installing and Running decksh/pdfdeck

Installing and Running decksh/pdfdeck

Anthony Starks

May 06, 2023
Tweet

More Decks by Anthony Starks

Other Decks in Design

Transcript

  1. Installing and Running decksh/pdfdeck

    View full-size slide

  2. Installing using go and git
    (Update your PATH environment variable to include the location of the installed binaries, typically
    $HOME/go/bin)
    $ go install github.com/ajstarks/decksh/cmd/decksh@latest
    Install the latest version of decksh
    $ go install github.com/ajstarks/deck/cmd/pdfdeck@latest
    Install the latest version of pdfdeck
    $ git clone https://github.com/ajstarks/deckfonts $HOME
    Install fonts into $HOME/deckfonts
    $ decksh -help
    $ pdfdeck -help
    Do a test run of decksh and pdfdeck

    View full-size slide

  3. Installing decksh and pdfdeck binaries
    https://github.com/ajstarks/decksh/tree/master/cmd/decksh/binaries
    https://github.com/ajstarks/deck/tree/master/cmd/pdfdeck/binaries
    Pick your type, download,
    rename to 'decksh', place
    where your apps live.
    Pick your type, download,
    rename to 'pdfdeck', place
    where your apps live.

    View full-size slide

  4. Downloading the fonts
    Download, unzip
    to your home
    directory.

    View full-size slide

  5. Fonts Catalog

    View full-size slide

  6. Default Fonts
    Times times timesi timesi timesb timesbi
    Helvetica helvetica helveticai helveticab helveticabi
    Courier courier courieri courierb courierbi

    View full-size slide

  7. Alternative serif, sans, mono
    Charter Charter-Regular Charter-Italic
    Fira Sans FiraSans-Book FiraSans-Medium FiraSans-Regular
    Inconsolata Inconsolata-Regular Inconsolata-Bold Inconsolata-Medium Inconsolata-Condensed

    View full-size slide

  8. Symbol fonts
    Zapf Dingbats zapfdingbats
    Gophers gophers
    State Face stateface
    Wee People weepeople

    View full-size slide

  9. Workflow
    think
    command
    render edit/save

    View full-size slide

  10. Working setup
    decksh code
    commands
    output
    edit/save
    execute render
    editor
    terminal
    viewer

    View full-size slide

  11. VSCode: Editor for Mac, Windows, and Linux
    decksh code with
    syntax highlighting
    Integrated terminal
    Status showing decksh mode

    View full-size slide

  12. Mac: Preview Windows: Sumatra PDF Linux: mupdf
    PDF Readers

    View full-size slide

  13. Mac OS
    editor: VSCode
    terminal: VSCode
    viewer: Preview

    View full-size slide

  14. Windows
    editor: VSCode
    terminal: VSCode
    viewer: Sumatra PDF

    View full-size slide

  15. Linux
    editor: VSCode
    terminal: VSCode
    viewer: mupdf

    View full-size slide

  16. no grid
    -grid 5
    Using the -grid option

    View full-size slide

  17. VSCode setup
    copy this to your settings
    "editor.tokenColorCustomizations": {
    "textMateRules": [
    {
    "scope": "keyword.other.command.decksh",
    "settings": {
    "foreground": "#AA0000"
    }
    },
    ...
    }
    copy to .vscode/extensions/ajstarks.decksh-1.0.0
    https://github.com/ajstarks/decksh/tree/master/vscode

    View full-size slide

  18. vim setup
    copy to .vim
    https://github.com/ajstarks/decksh/tree/master/vim

    View full-size slide

  19. Sublime Text Setup
    copy to dsh.* files ~/.config/sublime-text/Packages/User, copy dpdfr to your PATH
    https://github.com/ajstarks/decksh/tree/master/sublime-text
    CTRL-B to build and display

    View full-size slide

  20. The command line

    View full-size slide

  21. decksh command usage
    decksh example.dsh | pdfdeck ...
    decksh
    decksh in.dsh
    decksh -o out.xml
    decksh -o out.xml in.dsh
    read from stdin, write to stdout
    read from file, write to stdout
    read from stdin, write to file
    read from file, write to file

    View full-size slide

  22. pdfdeck [options] inputfile
    Option
    -sans
    -serif
    -mono
    -symbol
    -pages
    -pagesize
    -grid
    -fontdir
    -outdir
    -stdout
    -author
    -title
    Default
    helvetica
    times
    courier
    zapfdingbats
    1-1000000
    Letter
    0
    $HOME/deckfonts
    Current directory
    false
    ""
    ""
    Description
    Sans Serif font
    Serif font
    Monospace font
    Symbol font
    Pages to output (first-last)
    Page size (w,h or Legal, Tabloid, A[3-5], ArchA, 4R, Index)
    Draw a grid at specified % (0 for no grid)
    Font directory
    Output directory
    Output to standard output
    Document author
    Document title

    View full-size slide

  23. command examples
    decksh -o file.xml file.dsh; pdfdeck file.xml
    process file.dsh to file.xml to file.pdf
    decksh file.dsh | pdfdeck -stdout - > output.pdf
    Pipe the output from decksh, making output.pdf
    pdfdeck -pagesize 1920,1080 -pages 10-20 -grid 5 file.xml
    render pages 10-20 to file.pdf, page size of 1920 (width) x 1080 (height) pixels, on a 5% grid
    pdfdeck -sans FiraSans-Regular -serif Charter-Regular -mono Inconsolata-Bold file.xml
    use FiraSans-Regular.ttf, Charter-Regular.ttf, and Inconsolata-Bold.ttf from the deckfonts directory
    echo file.dsh|entr -s 'decksh file.dsh|pdfdeck -stdout - > f.pdf; pkill -HUP mupdf'
    When file.dsh changes, make f.pdf, and refresh the viewer

    View full-size slide