public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: lf-araujo <luis.nando-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: pandoc-discuss <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Subject: Re: Here is a building system for complex pandoc documents, testing needed
Date: Sun, 27 Aug 2017 19:20:05 -0700 (PDT)	[thread overview]
Message-ID: <f6801b2d-39b8-43f2-8a99-afd1b4d353f8@googlegroups.com> (raw)
In-Reply-To: <83a45d4b-4b18-4cbf-868a-45324849a3a7-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>


[-- Attachment #1.1: Type: text/plain, Size: 7032 bytes --]



Hi,

Sorry for bumping this discussion. I am updating a builder I published in 
May, now with support for GNUMake in windows. I don’t run Windows in any 
machine or know anyone who runs it currently. Could anyone who have a 
Windows machine test the below code? There is one line that might cause 
errors, but shouldn’t crash the builder. It’s the if [[ "$OSTYPE" == 
"darwin" ]]; then open $@; else xdg-open $@;fi line. To test, only save the 
code as a Makefile in the same directory as gnumake.exe, create any simple 
test .md file in a subdirectory /source, and run it with make or make pdf. 

Examples of how to use the builder can be found here 
<https://lf-araujo.github.io/2017/08/14/mmv1.html>.


.DEFAULT_GOAL := pdf              






MD = $(wildcard source/*.md)              


PDF = output/$(notdir $(CURDIR)).pdf              


TEX = output/$(notdir $(CURDIR)).tex              


DOCX = output/$(notdir $(CURDIR)).docx              


HTML5 = output/$(notdir $(CURDIR)).html              


EPUB = output/$(notdir $(CURDIR)).epub              


BEAMER = output/$(notdir $(CURDIR))-presentation.pdf              






FILFILES = $(wildcard style/*.py)              


FILTERS := $(foreach FILFILES, $(FILFILES), --filter $(FILFILES))              


TEXFLAGS = -F pandoc-crossref -F pandoc-citeproc --latex-engine=xelatex              






ifneq ("$(wildcard style/template.tex)","")              


    TEXTEMPLATE := "--template=style/template.tex"              


endif              


ifneq ("$(wildcard style/reference.docx)","")              


    DOCXTEMPLATE := "--reference-docx=style/reference.docx"              


endif              


ifneq ("$(wildcard style/style.css)","")              


    CSS := "--include-in-header=style/style.css"              


endif              






help:              


    @echo '                                                                       '              


    @echo 'Makefile for automated typography using pandoc.                         '              


    @echo 'Version 1.1                        '              


    @echo '                                                                       '              


    @echo 'Usage:                                                                 '              


    @echo '   make prepare    first time use, setting the directories     '              


    @echo '   make html       generate a web version             '              


    @echo '   make pdf        generate a PDF file                '              


    @echo '   make docx       generate a Docx file               '              


    @echo '   make tex        generate a Latex file               '              


    @echo '   make beamer     generate a beamer presentation               '              


    @echo '   make all        generate all files                 '              


    @echo '   make update     update the makefile to last version       '              


    @echo '   make            will fallback to PDF               '              


    @echo '                                                                       '              


    @echo 'It implies some directories in the filesystem: source, output and style'              


    @echo 'It also implies that the bibliography will be defined via the yaml      '              


    @echo '                                                                       '              


    @echo 'Depends on pandoc-citeproc and pandoc-crossref                          '              


    @echo 'Get local templates with: pandoc -D latex/html/etc                       '              


    @echo '                                                                       '              














all : tex docx html5 epub pdf              










pdf:$(PDF)              


$(PDF): $(MD)              


    pandoc -o $@ source/*.md $(TEXTEMPLATE) $(TEXFLAGS) $(FILTERS) 2>output/pdf.log              


    if [[ "$OSTYPE" == "darwin" ]]; then open $@; else xdg-open $@;fi              






tex: $(TEX)              


$(TEX): $(MD)              


    pandoc -o $@ source/*.md $(TEXFLAGS) 2>output/tex.log              


    if [[ "$OSTYPE" == "darwin" ]]; then open $@; else xdg-open $@;fi              






docx: $(DOCX)              


$(DOCX): $(MD)              


    pandoc -o $@ source/*.md $(TEXFLAGS) $(DOCXTEMPLATE) --toc 2>output/docx.log              


    if [[ "$OSTYPE" == "darwin" ]]; then open $@; else xdg-open $@;fi              






html5: $(HTML5)              


$(HTML5): $(MD)              


    pandoc -o $@ source/*.md $(CSS) $(TEXFLAGS) --toc -t html5 2>output/html5.log              


    if [[ "$OSTYPE" == "darwin" ]]; then open $@; else xdg-open $@;fi              






epub: $(EPUB)              


$(EPUB): $(MD)              


    pandoc -o $@ source/*.md $(TEXFLAGS) --toc 2>output/epub.log              


    if [[ "$OSTYPE" == "darwin" ]]; then open $@; else xdg-open $@;fi              






beamer: $(BEAMER)              


$(BEAMER): $(MD)              


    pandoc -o $@ source/*.md $(TEXFLAGS) --toc -t beamer 2>output/beamer.log              


    if [[ "$OSTYPE" == "darwin" ]]; then open $@; else xdg-open $@;fi              






prepare:              


    command -v pandoc >/dev/null 2>&1 || { echo "I require pandoc but it's not installed.  Aborting." >&2; exit 1; }              


    command -v pandoc-crossref >/dev/null 2>&1 || { echo "I require pandoc-crossref but it's not installed.  Aborting." >&2; exit 1; }              


    command -v pandoc-citeproc >/dev/null 2>&1 || { echo "I require pandoc-citeproc but it's not installed.  Aborting." >&2; exit 1; }              


    mkdir "output"              


    mkdir "source"              


    mkdir "style"              






update:              


    wget http://tiny.cc/mighty_make -O Makefile              






clean:              


    rm -f "output/" *.md *.html *.pdf *.tex *.docx *.epub              






.PHONY: help prepare update beamer clean

Thank you.
​

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/f6801b2d-39b8-43f2-8a99-afd1b4d353f8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #1.2: Type: text/html, Size: 57460 bytes --]

      parent reply	other threads:[~2017-08-28  2:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-11  7:59 lf-araujo
     [not found] ` <83a45d4b-4b18-4cbf-868a-45324849a3a7-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2017-05-11  8:42   ` John MacFarlane
2017-08-28  2:20   ` lf-araujo [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f6801b2d-39b8-43f2-8a99-afd1b4d353f8@googlegroups.com \
    --to=luis.nando-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).