GithubHelp home page GithubHelp logo

howmanyoliversarethere / md2pdf-client Goto Github PK

View Code? Open in Web Editor NEW

This project forked from seanlano/md2pdf-client

0.0 2.0 0.0 85 KB

A client application for connecting to the md2pdf-webserver REST interface

License: GNU Affero General Public License v3.0

Python 100.00%

md2pdf-client's Introduction

md2pdf Client

md2pdf icon

Introduction

md2pdf is a little project that aims to make it easy to produce professional-looking PDF documents from Markdown files via a LaTeX template and the help of Pandoc.

There are several motivations for this:

  • Word processor software does not work very nicely with version control, plain-text Markdown files do
  • Collaborating on a single ODT/DOC file is prone to overwriting others' work
  • LibreOffice and Word both suck with automatic figure and table numbering on long files, and with TOCs etc
  • It's painful trying to keep everyone using the right font, spacing, formatting, etc. when collaborating with ODT/DOC files
  • PDF output from LibreOffice and Word often looks pretty average
  • It's distracting having to worry about formatting while writing - Markdown takes away all but the most basic formatting options to focus you on writing

With with an appropriate template, LaTeX PDF output is undeniably the prettiest- looking way to create documents. But, learning LaTeX is hard. Markdown is much easier to use, and when used with Pandoc can still produce superb PDF documents. md2pdf makes it simple to manage having the right LaTeX templates and configuration across a whole team, by using a central server to do the PDF generation and then share the result with those who need it.

Client application

This simple Python program is the md2pdf client application. It is intended to be used with an md2pdf-webserver instance, running locally or remotely. See the md2pdf-webserver hompage for more information

Usage

Usage is quite simple, run md2pdf-client -h for more information:

usage: md2pdf_client.py [-h] [--set-default OPTION VALUE] [-s ADDRESS[:PORT]]
                        [--proto {http,https}] [-t TEMPLATE]
                        [FILEPATH]

md2pdf client - connect to an md2pdf server and create a PDF file

positional arguments:
  FILEPATH              Input Markdown file to be converted

optional arguments:
  -h, --help            show this help message and exit
  --set-default OPTION VALUE
                        Change a default value for an option. Use the full
                        argument name, separated by a space, e.g.: '--set-
                        default proto https' or '--set-default server
                        192.168.1.1:9090'
  -s ADDRESS[:PORT], --server ADDRESS[:PORT]
                        Server address to request PDF generation from. Use
                        hostname or IP address, and port number if required
                        (i.e. '127.0.0.1:9090', or 'my-host.com:8888'). If
                        port is not specified, port 80 will be used
  --proto {http,https}  Protocol to use
  -t TEMPLATE, --template TEMPLATE
                        Template to use, instead of the server default
                        (include the file extension)

Usage hints

  • Don't forget to set a default port when you set the default server! You probably won't be using port 80, so make sure you set it correctly, with something like md2pdf-client --set-default server 1.2.3.4:9090 or md2pdf-client --set-default server hostname.tld:9090. Don't include the protocol here.
  • md2pdf-webserver by default doesn't do HTTPS - but it would be possible to put it behind a HTTPS reverse proxy. If that is the case, don't forget to set the default protocol with md2pdf-client --set-default proto https
  • If you use the --template option, don't forget that the template must also exist in the server - you can't use a local template (at least not yet).
  • If something doesn't work on the server end, you should get a .log file in the same directory as your input Markdown file - take a look in there for more information.
  • If something doesn't work on the client end, it can be helpful to run md2pdf-client from the command line to check the output.

Installation

Snap Package

md2pdf-client is available as an Ubuntu Snap package. You can install it with :

$ sudo snap install md2pdf-client

The packaging is done automatically by Launchpad, based on the Snapcraft config in this repo.

Direct Python script

It can also be run as a Python script:

python3 md2pdf_client.py -f <file>

License

This project is released under the terms of the GNU Affero GPL version 3 (or later). Please see LICENSE for details.

Thanks

The base of my (very crappy) icon is from the standard GNOME icons. These are GPL licensed.

md2pdf-client's People

Contributors

seanlano avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.