Parcourir la source

add a barebones HTML template and mention it

George C. Privon il y a 7 ans
Parent
commit
218a2457a6
2 fichiers modifiés avec 97 ajouts et 2 suppressions
  1. 13 2
      aastex62/README.md
  2. 84 0
      aastex62/aastex62_website_template.html

+ 13 - 2
aastex62/README.md

@@ -1,6 +1,6 @@
 # AASTeX Pandoc Template
 
-Generate a `tex` file with:
+Generate a TeX file with:
 
 ```
 pandoc demo.md -s --template aastex62_template.tex -o demo.tex -F pandoc-crossref -F pandoc-citeproc --lua-filter=filters/acknowledgments.lua --no-highlight
@@ -12,7 +12,7 @@ Go straight to the pdf with:
 pandoc demo.md -s --template aastex62_template.tex -o demo.pdf -F pandoc-crossref -F pandoc-citeproc --lua-filter=filters/acknowledgments.lua --pdf-engine=xelatex --no-highlight
 ```
 
-The `demo.md` file contains a sample article describing the use of this template in generating AASTeX output via pandoc.
+The [`demo.md`](demo.md) file contains a sample article describing the use of this template in generating AASTeX output via pandoc.
 
 ## Usage Notes
 
@@ -22,6 +22,17 @@ The `demo.md` file contains a sample article describing the use of this template
 
 * For collaborations, authors will be grouped until there is a `collaboration: ` entry in the YAML header. If a co-author that is not part of a listed collaboration is listed before co-authors that are part of collaborations, put `nocollaboration: 1` in the YAML header to signify as such and avoid them being grouped with the later batch. See [demo.md](demo.md) for an example.
 
+### Output to HTML (and Other Formats)
+
+In addition to TeX and PDF pandoc can output to a [variety of formats](https://pandoc.org/MANUAL.html#general-options) and pandoc ships with default templates for each.
+However, in order to take full advantage of the additional information contained in the YAML header, a custom template should be written.
+A bare-bones example HTML template is provided in the [`aastex62_website_template.html`](aastex62_website_template.html) file.
+This, along with `demo.md`, can be converted to a HTML page with:
+
+```
+pandoc demo.md -s --template aastex62_website_template.html -o demo.html -F pandoc-crossref -F pandoc-citeproc --lua-filter=filters/acknowledgments.lua
+```
+
 ## Known Issues
 
 * AASTeX table environments pass through to LaTeX without trouble. But note that these will not translate to other outputs (HTML, epub, etc.). So consider what your desired outputs will be before you put lots of effort into tables. Or write a [pandoc filter](https://pandoc.org/filters.html) to handle tables.

+ 84 - 0
aastex62/aastex62_website_template.html

@@ -0,0 +1,84 @@
+<html lang="en">
+<head>
+    <meta charset="utf-8">
+    <title>$title$</title>
+</head>
+<body>
+
+<header>
+<h1>$title$</h1>
+
+
+<p>
+$if(submitjournal)$
+Submitted to $submitjournal$.<br>
+$endif$
+
+$if(received)$
+Received: $received$;
+$endif$
+
+$if(revised)$
+Revised $revised$;
+$endif$
+
+$if(accepted)$
+Accepted $accepted$
+$endif$
+</p>
+
+<p>
+Authors: 
+$for(author)$
+    $author.name$
+    $if(author.affiliation)$
+    (
+    $for(author.affiliation)$
+    $author.affiliation$,
+    $endfor$
+    )
+    $endif$
+    ,
+$endfor$
+</p>
+
+$if(keywords)$
+<p>
+Keywords:
+$for(keywords)$
+$keywords$ ---
+$endfor$
+</p>
+$endif$
+</header>
+
+<main>
+$if(abstract)$
+<h2>Abstract</h2>
+<p>
+$abstract$
+</p>
+$endif$
+
+$body$
+
+</main>
+
+<footer>
+$if(software)$
+Software:
+$for(software)$
+$software$,
+$endfor$
+$endif$
+
+$if(facility)$
+Facilities: 
+$for(facility)$
+$facility$,
+$endfor$
+$endif$
+</footer>
+
+</body>
+</html>