summaryrefslogtreecommitdiff
path: root/trypandoc
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2022-08-23 11:42:42 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2022-08-23 11:42:42 -0700
commit8227d3801677d5d6192437e1cd920ea9e98f4782 (patch)
treee71b434d32918504a2ff1ca1c49f20e2db81a82e /trypandoc
parent393a37fc2ae086eb82d93e48e0b4d9497825f6dc (diff)
trypandoc: Improve treatment of examples.
Diffstat (limited to 'trypandoc')
-rw-r--r--trypandoc/index.html19
-rw-r--r--trypandoc/trypandoc.js152
2 files changed, 157 insertions, 14 deletions
diff --git a/trypandoc/index.html b/trypandoc/index.html
index 9817c3689..3e8ffb9cf 100644
--- a/trypandoc/index.html
+++ b/trypandoc/index.html
@@ -34,6 +34,15 @@
<div id="title">
<h1>Try <a href="https://pandoc.org">pandoc</a>!</h1>
</div>
+ <div id="examplediv">
+ <select id="examples">
+ <option value="" selected disabled>Select an example</option>
+ <option value="bibtex_to_csl_json">BibTeX to CSL JSON</option>
+ <option value="markdown_to_man_with_citations">Markdown to man with citation</option>
+ <option value="mediawiki_to_docx_with_equations">MediaWiki to docx with equations</option>
+ <option value="html_to_restructuredtext">HTML to reStructuredText</option>
+ </select>
+ </div>
<div id="command">
<pre id="command"></pre>
</div>
@@ -97,16 +106,6 @@
-->
<textarea id="text" rows="15"></textarea>
<br/>
- <label for="examples">
- Examples
- </label>
- <select id="examples">
- <option value="" selected disabled>Select an example</option>
- <option value="https://pandoc.org/try/?text=%40BOOK%7BWurm2011-ho%2C%0A++title+++++%3D+%22%7BSubstanz+und+Qualität+%3A+Ein+Beitrag+zur+Interpretation+der%0A+++++++++++++++plotinischen+Traktate+VI%2C1%2C+2+und+3%7D%22%2C%0A++author++++%3D+%22Wurm%2C+Klaus%22%2C%0A++publisher+%3D+%22De+Gruyter%22%2C%0A++series++++%3D+%22Quellen+und+Studien+zur+Philosophie%22%2C%0A++edition+++%3D+%22Reprint+2011%22%2C%0A++year++++++%3D++2011%2C%0A++address+++%3D+%22Berlin%22%2C%0A++keywords++%3D+%22%21%21%21+Plotinus+translation%22%2C%0A++language++%3D+%22de%22%0A%7D%0A&from=bibtex&to=csljson&standalone=false">BibTeX to CSL JSON</option>
- <option value="https://pandoc.org/try/?text=---%0Areferences%3A%0A-+author%3A%0A++-+family%3A+Salam%0A++++given%3A+Abdus%0A++container-title%3A+%22Elementary+particle+theory%3A+Relativistic+groups+and%0A++++analyticity.+Proceedings+of+the+eighth+Nobel+symposium%22%0A++editor%3A%0A++-+family%3A+Svartholm%0A++++given%3A+Nils%0A++event-date%3A+1968-05-19%2F1968-05-25%0A++event-place%3A+Aspenäsgarden%2C+Lerum%0A++id%3A+salam%0A++issued%3A+1968%0A++page%3A+367-377%0A++publisher%3A+Almquist+%26+Wiksell%0A++publisher-place%3A+Stockholm%0A++title%3A+Weak+and+electromagnetic+interactions%0A++type%3A+paper-conference%0A---%0A%0A%40salam+%5Bp.+370%5D+says+some+interesting+things.%0A&from=markdown&to=man&standalone=false&citeproc=true">Markdown to man with citation</option>
- <option value="https://pandoc.org/try/?text=%3D%3D+Definition+%3D%3D%0AAlthough+seemingly+different%2C+the+various+approaches+to+defining+tensors+describe+the+same+geometric+concept+using+different+language+and+at+different+levels+of+abstraction.%0A%0A%3D%3D%3D+As+multidimensional+arrays+%3D%3D%3D%0AA+tensor+may+be+represented+as+an+array+%28potentially+multidimensional%29.+Just+as+a+%5B%5BVector+space%7Cvector%5D%5D+in+an+%7B%7Bmvar%7Cn%7D%7D-%5B%5Bdimension+%28vector+space%29%7Cdimensional%5D%5D+space+is+represented+by+a+one-dimensional+array+with+%7B%7Bmvar%7Cn%7D%7D+components+with+respect+to+a+given+%5B%5BBasis+%28linear+algebra%29%23Ordered+bases+and+coordinates%7Cbasis%5D%5D%2C+any+tensor+with+respect+to+a+basis+is+represented+by+a+multidimensional+array.++For+example%2C+a+%5B%5Blinear+operator%5D%5D+is+represented+in+a+basis+as+a+two-dimensional+square+%7B%7Bmath%7C%27%27n%27%27+×+%27%27n%27%27%7D%7D+array.++The+numbers+in+the+multidimensional+array+are+known+as+the+%27%27scalar+components%27%27+of+the+tensor+or+simply+its+%27%27components%27%27.++They+are+denoted+by+indices+giving+their+position+in+the+array%2C+as+%5B%5Bsubscript+and+superscript%7Csubscripts+and+superscripts%5D%5D%2C+following+the+symbolic+name+of+the+tensor.++For+example%2C+the+components+of+an+order+%7B%7Bmath%7C2%7D%7D+tensor+%7B%7Bmvar%7CT%7D%7D+could+be+denoted+%7B%7Bmath%7C%27%27T%27%27%3Csub%3E%27%27ij%27%27%3C%2Fsub%3E%7D%7D%E2%80%AF%2C+where+%7B%7Bmvar%7Ci%7D%7D+and+%7B%7Bmvar%7Cj%7D%7D+are+indices+running+from+%7B%7Bmath%7C1%7D%7D+to+%7B%7Bmvar%7Cn%7D%7D%2C+or+also+by+%7B%7Bmath%7C%27%27T%27%27%26thinsp%3B%7B%7Bsu%7Cb%3D%27%27j%27%27%7Cp%3D%27%27i%27%27%7D%7D%7D%7D.++Whether+an+index+is+displayed+as+a+superscript+or+subscript+depends+on+the+transformation+properties+of+the+tensor%2C+described+below.+Thus+while+%7B%7Bmath%7C%27%27T%27%27%3Csub%3E%27%27ij%27%27%3C%2Fsub%3E%7D%7D+and+%7B%7Bmath%7C%27%27T%27%27%26thinsp%3B%7B%7Bsu%7Cb%3D%27%27j%27%27%7Cp%3D%27%27i%27%27%7D%7D%7D%7D+can+both+be+expressed+as+%27%27n%27%27+by+%27%27n%27%27+matrices%2C+and+are+numerically+related+via+%5B%5BRaising+and+lowering+indices%7Cindex+juggling%5D%5D%2C+the+difference+in+their+transformation+laws+indicates+it+would+be+improper+to+add+them+together.+The+total+number+of+indices+required+to+identify+each+component+uniquely+is+equal+to+the+%5B%5BArray+data+structure%23Dimension%7Cdimension%5D%5D+of+the+array%2C+and+is+called+the+%27%27order%27%27%2C+%27%27degree%27%27+or+%27%27rank%27%27+of+the+tensor.++However%2C+the+term+%22rank%22+generally+has+%5B%5Btensor+rank%7Canother+meaning%5D%5D+in+the+context+of+matrices+and+tensors.%0A%0AJust+as+the+components+of+a+vector+change+when+we+change+the+%5B%5Bbasis+%28linear+algebra%29%7Cbasis%5D%5D+of+the+vector+space%2C+the+components+of+a+tensor+also+change+under+such+a+transformation.++Each+type+of+tensor+comes+equipped+with+a+%27%27transformation+law%27%27+that+details+how+the+components+of+the+tensor+respond+to+a+%5B%5Bchange+of+basis%5D%5D.++The+components+of+a+vector+can+respond+in+two+distinct+ways+to+a+%5B%5Bchange+of+basis%5D%5D+%28see+%5B%5Bcovariance+and+contravariance+of+vectors%5D%5D%29%2C+where+the+new+%5B%5Bbasis+vectors%5D%5D+%3Cmath%3E%5Cmathbf%7B%5Chat%7Be%7D%7D_i%3C%2Fmath%3E+are+expressed+in+terms+of+the+old+basis+vectors+%3Cmath%3E%5Cmathbf%7Be%7D_j%3C%2Fmath%3E+as%2C%0A%3A%3Cmath%3E%5Cmathbf%7B%5Chat%7Be%7D%7D_i+%3D+%5Csum_%7Bj%3D1%7D%5En+%5Cmathbf%7Be%7D_j+R%5Ej_i+%3D+%5Cmathbf%7Be%7D_j+R%5Ej_i+.%3C%2Fmath%3E%0A%0AHere+%27%27R%27%27%3Csup%3E%27%27+j%27%27%3C%2Fsup%3E%3Csub%3E%27%27i%27%27%3C%2Fsub%3E+are+the+entries+of+the+change+of+basis+matrix%2C+and+in+the+rightmost+expression+the+%5B%5Bsummation%5D%5D+sign+was+suppressed%3A+this+is+the+%5B%5BEinstein+summation+convention%5D%5D%2C+which+will+be+used+throughout+this+article.%3Cref+group%3D%22Note%22%3EThe+Einstein+summation+convention%2C+in+brief%2C+requires+the+sum+to+be+taken+over+all+values+of+the+index+whenever+the+same+symbol+appears+as+a+subscript+and+superscript+in+the+same+term.++For+example%2C+under+this+convention+%3Cmath%3EB_i+C%5Ei+%3D+B_1+C%5E1+%2B+B_2+C%5E2+%2B+%5Ccdots+B_n+C%5En%3C%2Fmath%3E%3C%2Fref%3E++The+components+%27%27v%27%27%3Csup%3E%27%27i%27%27%3C%2Fsup%3E+of+a+column+vector+%27%27%27v%27%27%27+transform+with+the+%5B%5Bmatrix+inverse%7Cinverse%5D%5D+of+the+matrix+%27%27R%27%27%2C%0A%3A%3Cmath%3E%5Chat%7Bv%7D%5Ei+%3D+%5Cleft%28R%5E%7B-1%7D%5Cright%29%5Ei_j+v%5Ej%2C%3C%2Fmath%3E%0A%0Awhere+the+hat+denotes+the+components+in+the+new+basis.++This+is+called+a+%27%27contravariant%27%27+transformation+law%2C+because+the+vector+components+transform+by+the+%27%27inverse%27%27+of+the+change+of+basis.++In+contrast%2C+the+components%2C+%27%27w%27%27%3Csub%3E%27%27i%27%27%3C%2Fsub%3E%2C+of+a+covector+%28or+row+vector%29%2C+%27%27%27w%27%27%27%2C+transform+with+the+matrix+%27%27R%27%27+itself%2C%0A%3A%3Cmath%3E%5Chat%7Bw%7D_i+%3D+w_j+R%5Ej_i+.%3C%2Fmath%3E&from=mediawiki&to=docx&standalone=false">MediaWiki to docx with equations</option>
- <option value="https://pandoc.org/try/?text=%3Ch2+class%3D%22options%22+id%3D%22reader-options%22%3EReader+options%3C%2Fh2%3E%0A%3Cdl%3E%0A%3Cdt%3E%3Ccode%3E--shift-heading-level-by%3D%3C%2Fcode%3E%3Cem%3ENUMBER%3C%2Fem%3E%3C%2Fdt%3E%0A%3Cdd%3E%0A%3Cp%3EShift+heading+levels+by+a+positive+or+negative+integer.+For+example%2C%0Awith+%3Ccode%3E--shift-heading-level-by%3D-1%3C%2Fcode%3E%2C+level+2+headings+become%0Alevel+1+headings%2C+and+level+3+headings+become+level+2+headings.+Headings%0Acannot+have+a+level+less+than+1%2C+so+a+heading+that+would+be+shifted%0Abelow+level+1+becomes+a+regular+paragraph.+Exception%3A+with+a+shift+of%0A-N%2C+a+level-N+heading+at+the+beginning+of+the+document+replaces+the%0Ametadata+title.+%3Ccode%3E--shift-heading-level-by%3D-1%3C%2Fcode%3E+is+a+good%0Achoice+when+converting+HTML+or+Markdown+documents+that+use+an+initial%0Alevel-1+heading+for+the+document+title+and+level-2%2B+headings+for%0Asections.+%3Ccode%3E--shift-heading-level-by%3D1%3C%2Fcode%3E+may+be+a+good+choice%0Afor+converting+Markdown+documents+that+use+level-1+headings+for+sections%0Ato+HTML%2C+since+pandoc+uses+a+level-1+heading+to+render+the+document%0Atitle.%3C%2Fp%3E%0A%3C%2Fdd%3E%0A%3Cdt%3E%3Ccode%3E--base-header-level%3D%3C%2Fcode%3E%3Cem%3ENUMBER%3C%2Fem%3E%3C%2Fdt%3E%0A%3Cdd%3E%0A%3Cp%3E%3Cem%3EDeprecated.+Use+%3Ccode%3E--shift-heading-level-by%3C%2Fcode%3E%3DX+instead%2C%0Awhere+X+%3D+NUMBER+-+1.%3C%2Fem%3E+Specify+the+base+level+for+headings+%28defaults%0Ato+1%29.%3C%2Fp%3E%0A%3C%2Fdd%3E%0A%3Cdt%3E%3Ccode%3E--strip-empty-paragraphs%3C%2Fcode%3E%3C%2Fdt%3E%0A%3Cdd%3E%0A%3Cp%3E%3Cem%3EDeprecated.+Use+the+%3Ccode%3E%2Bempty_paragraphs%3C%2Fcode%3E+extension%0Ainstead.%3C%2Fem%3E+Ignore+paragraphs+with+no+content.+This+option+is+useful%0Afor+converting+word+processing+documents+where+users+have+used+empty%0Aparagraphs+to+create+inter-paragraph+space.%3C%2Fp%3E%0A%3C%2Fdd%3E%0A%3Cdt%3E%3Ccode%3E--indented-code-classes%3D%3C%2Fcode%3E%3Cem%3ECLASSES%3C%2Fem%3E%3C%2Fdt%3E%0A%3Cdt%3E%3Ccode%3E-L%3C%2Fcode%3E+%3Cem%3ESCRIPT%3C%2Fem%3E%2C%0A%3Ccode%3E--lua-filter%3D%3C%2Fcode%3E%3Cem%3ESCRIPT%3C%2Fem%3E%3C%2Fdt%3E%0A%3Cdd%3E%0A%3Cp%3ETransform+the+document+in+a+similar+fashion+as+JSON+filters+%28see%0A%3Ccode%3E--filter%3C%2Fcode%3E%29%2C+but+use+pandoc%E2%80%99s+built-in+Lua+filtering+system.%0AThe+given+Lua+script+is+expected+to+return+a+list+of+Lua+filters+which%0Awill+be+applied+in+order.+Each+Lua+filter+must+contain%0Aelement-transforming+functions+indexed+by+the+name+of+the+AST+element+on%0Awhich+the+filter+function+should+be+applied.%3C%2Fp%3E%0A%3Cp%3EThe+%3Ccode%3Epandoc%3C%2Fcode%3E+Lua+module+provides+helper+functions+for%0Aelement+creation.+It+is+always+loaded+into+the+script%E2%80%99s+Lua%0Aenvironment.%3C%2Fp%3E%0A%3Cp%3ESee+the+%3Ca+href%3D%22https%3A%2F%2Fpandoc.org%2Flua-filters.html%22%3ELua+filters%0Adocumentation%3C%2Fa%3E+for+further+details.%3C%2Fp%3E%0A%3Cp%3EIn+order+of+preference%2C+pandoc+will+look+for+Lua+filters+in%3C%2Fp%3E%0A%3Col+type%3D%221%22%3E%0A%3Cli%3E%3Cp%3Ea+specified+full+or+relative+path%2C%3C%2Fp%3E%3C%2Fli%3E%0A%3Cli%3E%3Cp%3E%3Ccode%3E%24DATADIR%2Ffilters%3C%2Fcode%3E+where+%3Ccode%3E%24DATADIR%3C%2Fcode%3E+is+the%0Auser+data+directory+%28see+%3Ccode%3E--data-dir%3C%2Fcode%3E%2C+above%29.%3C%2Fp%3E%3C%2Fli%3E%0A%3C%2Fol%3E%0A%3Cp%3EFilters%2C+Lua+filters%2C+and+citeproc+processing+are+applied+in+the%0Aorder+specified+on+the+command+line.%3C%2Fp%3E%0A%3C%2Fdd%3E%0A%3Cdt%3E%3Ccode%3E--trace%3C%2Fcode%3E%3C%2Fdt%3E%0A%3Cdd%3E%0A%3Cp%3EPrint+diagnostic+output+tracing+parser+progress+to+stderr.+This%0Aoption+is+intended+for+use+by+developers+in+diagnosing+performance%0Aissues.%3C%2Fp%3E%0A%3C%2Fdd%3E%0A%3C%2Fdl%3E%0A&from=html&to=rst&standalone=false&citeproc=true">HTML to reStructuredText</option>
- </select>
</div>
<div id="topane">
diff --git a/trypandoc/trypandoc.js b/trypandoc/trypandoc.js
index dbad57c6b..64579df3b 100644
--- a/trypandoc/trypandoc.js
+++ b/trypandoc/trypandoc.js
@@ -8,6 +8,143 @@ var params = {
citeproc: false,
files: {} };
+const examples = {
+ bibtex_to_csl_json:
+ { text: `@BOOK{Wurm2011-ho,
+ title = "{Substanz und Qualität : Ein Beitrag zur Interpretation der
+ plotinischen Traktate VI,1, 2 und 3}",
+ author = "Wurm, Klaus",
+ publisher = "De Gruyter",
+ series = "Quellen und Studien zur Philosophie",
+ edition = "Reprint 2011",
+ year = 2011,
+ address = "Berlin",
+ keywords = "!!! Plotinus translation",
+ language = "de"
+}`,
+ from: 'bibtex',
+ to: 'csljson',
+ standalone: false,
+ citeproc: false,
+ files: {} },
+ markdown_to_man_with_citations:
+ { text: `---
+references:
+- author:
+ - family: Salam
+ given: Abdus
+ container-title: "Elementary particle theory: Relativistic groups and
+ analyticity. Proceedings of the eighth Nobel symposium"
+ editor:
+ - family: Svartholm
+ given: Nils
+ event-date: 1968-05-19/1968-05-25
+ event-place: Aspenäsgarden, Lerum
+ id: salam
+ issued: 1968
+ page: 367-377
+ publisher: Almquist & Wiksell
+ publisher-place: Stockholm
+ title: Weak and electromagnetic interactions
+ type: paper-conference
+---
+
+@salam [p. 370] says some interesting things.`,
+ from: 'markdown',
+ to: 'man',
+ standalone: false,
+ citeproc: true,
+ files: {} },
+ mediawiki_to_docx_with_equations:
+ { text: `== Definition ==
+Although seemingly different, the various approaches to defining tensors describe the same geometric concept using different language and at different levels of abstraction.
+
+=== As multidimensional arrays ===
+A tensor may be represented as an array (potentially multidimensional). Just as a [[Vector space|vector]] in an {{mvar|n}}-[[dimension (vector space)|dimensional]] space is represented by a one-dimensional array with {{mvar|n}} components with respect to a given [[Basis (linear algebra)#Ordered bases and coordinates|basis]], any tensor with respect to a basis is represented by a multidimensional array. For example, a [[linear operator]] is represented in a basis as a two-dimensional square {{math|''n'' × ''n''}} array. The numbers in the multidimensional array are known as the ''scalar components'' of the tensor or simply its ''components''. They are denoted by indices giving their position in the array, as [[subscript and superscript|subscripts and superscripts]], following the symbolic name of the tensor. For example, the components of an order {{math|2}} tensor {{mvar|T}} could be denoted {{math|''T''<sub>''ij''</sub>}} , where {{mvar|i}} and {{mvar|j}} are indices running from {{math|1}} to {{mvar|n}}, or also by {{math|''T''&thinsp;{{su|b=''j''|p=''i''}}}}. Whether an index is displayed as a superscript or subscript depends on the transformation properties of the tensor, described below. Thus while {{math|''T''<sub>''ij''</sub>}} and {{math|''T''&thinsp;{{su|b=''j''|p=''i''}}}} can both be expressed as ''n'' by ''n'' matrices, and are numerically related via [[Raising and lowering indices|index juggling]], the difference in their transformation laws indicates it would be improper to add them together. The total number of indices required to identify each component uniquely is equal to the [[Array data structure#Dimension|dimension]] of the array, and is called the ''order'', ''degree'' or ''rank'' of the tensor. However, the term "rank" generally has [[tensor rank|another meaning]] in the context of matrices and tensors.
+
+Just as the components of a vector change when we change the [[basis (linear algebra)|basis]] of the vector space, the components of a tensor also change under such a transformation. Each type of tensor comes equipped with a ''transformation law'' that details how the components of the tensor respond to a [[change of basis]]. The components of a vector can respond in two distinct ways to a [[change of basis]] (see [[covariance and contravariance of vectors]]), where the new [[basis vectors]] <math>\mathbf{\hat{e}}_i</math> are expressed in terms of the old basis vectors <math>\mathbf{e}_j</math> as,
+:<math>\mathbf{\hat{e}}_i = \sum_{j=1}^n \mathbf{e}_j R^j_i = \mathbf{e}_j R^j_i .</math>
+
+Here ''R''<sup>'' j''</sup><sub>''i''</sub> are the entries of the change of basis matrix, and in the rightmost expression the [[summation]] sign was suppressed: this is the [[Einstein summation convention]], which will be used throughout this article.<ref group="Note">The Einstein summation convention, in brief, requires the sum to be taken over all values of the index whenever the same symbol appears as a subscript and superscript in the same term. For example, under this convention <math>B_i C^i = B_1 C^1 + B_2 C^2 + \cdots B_n C^n</math></ref> The components ''v''<sup>''i''</sup> of a column vector '''v''' transform with the [[matrix inverse|inverse]] of the matrix ''R'',
+:<math>\hat{v}^i = \left(R^{-1}\right)^i_j v^j,</math>
+
+where the hat denotes the components in the new basis. This is called a ''contravariant'' transformation law, because the vector components transform by the ''inverse'' of the change of basis. In contrast, the components, ''w''<sub>''i''</sub>, of a covector (or row vector), '''w''', transform with the matrix ''R'' itself,
+:<math>\hat{w}_i = w_j R^j_i .</math>`,
+ from: 'mediawiki',
+ to: 'docx',
+ standalone: true,
+ citeproc: false,
+ files: {} },
+ html_to_restructuredtext:
+ { text: `<h2 class="options" id="reader-options">Reader options</h2>
+<dl>
+<dt><code>--shift-heading-level-by=</code><em>NUMBER</em></dt>
+<dd>
+<p>Shift heading levels by a positive or negative integer. For example,
+with <code>--shift-heading-level-by=-1</code>, level 2 headings become
+level 1 headings, and level 3 headings become level 2 headings. Headings
+cannot have a level less than 1, so a heading that would be shifted
+below level 1 becomes a regular paragraph. Exception: with a shift of
+-N, a level-N heading at the beginning of the document replaces the
+metadata title. <code>--shift-heading-level-by=-1</code> is a good
+choice when converting HTML or Markdown documents that use an initial
+level-1 heading for the document title and level-2+ headings for
+sections. <code>--shift-heading-level-by=1</code> may be a good choice
+for converting Markdown documents that use level-1 headings for sections
+to HTML, since pandoc uses a level-1 heading to render the document
+title.</p>
+</dd>
+<dt><code>--base-header-level=</code><em>NUMBER</em></dt>
+<dd>
+<p><em>Deprecated. Use <code>--shift-heading-level-by</code>=X instead,
+where X = NUMBER - 1.</em> Specify the base level for headings (defaults
+to 1).</p>
+</dd>
+<dt><code>--strip-empty-paragraphs</code></dt>
+<dd>
+<p><em>Deprecated. Use the <code>+empty_paragraphs</code> extension
+instead.</em> Ignore paragraphs with no content. This option is useful
+for converting word processing documents where users have used empty
+paragraphs to create inter-paragraph space.</p>
+</dd>
+<dt><code>--indented-code-classes=</code><em>CLASSES</em></dt>
+<dt><code>-L</code> <em>SCRIPT</em>,
+<code>--lua-filter=</code><em>SCRIPT</em></dt>
+<dd>
+<p>Transform the document in a similar fashion as JSON filters (see
+<code>--filter</code>), but use pandoc’s built-in Lua filtering system.
+The given Lua script is expected to return a list of Lua filters which
+will be applied in order. Each Lua filter must contain
+element-transforming functions indexed by the name of the AST element on
+which the filter function should be applied.</p>
+<p>The <code>pandoc</code> Lua module provides helper functions for
+element creation. It is always loaded into the script’s Lua
+environment.</p>
+<p>See the <a href="https://pandoc.org/lua-filters.html">Lua filters
+documentation</a> for further details.</p>
+<p>In order of preference, pandoc will look for Lua filters in</p>
+<ol type="1">
+<li><p>a specified full or relative path,</p></li>
+<li><p><code>$DATADIR/filters</code> where <code>$DATADIR</code> is the
+user data directory (see <code>--data-dir</code>, above).</p></li>
+</ol>
+<p>Filters, Lua filters, and citeproc processing are applied in the
+order specified on the command line.</p>
+</dd>
+<dt><code>--trace</code></dt>
+<dd>
+<p>Print diagnostic output tracing parser progress to stderr. This
+option is intended for use by developers in diagnosing performance
+issues.</p>
+</dd>
+</dl>`,
+ from: 'html',
+ to: 'rst',
+ standalone: false,
+ citeproc: false,
+ files: {} }
+}
+
function permalink() {
let href = window.location.href;
const URLparams = new URLSearchParams(Object.entries(params));
@@ -95,14 +232,18 @@ function convert() {
};
}
-(function() {
- paramsFromURL();
+function setFormFromParams() {
document.getElementById("text").value = params.text;
document.getElementById("from").value = params.from;
document.getElementById("to").value = params.to;
document.getElementById("standalone").checked = params.standalone;
document.getElementById("citeproc").checked = params.citeproc;
+}
+
+(function() {
+ paramsFromURL();
+ setFormFromParams();
document.getElementById("convert").onclick = convert;
document.getElementById("from").onchange = (e) => {
params.from = e.target.value;
@@ -124,8 +265,11 @@ function convert() {
convert();
}
- document.getElementById("examples").onchange =
- (e => window.location.href = e.target.value );
+ document.getElementById("examples").onchange = (e) => {
+ params = examples[e.target.value];
+ setFormFromParams();
+ convert();
+ }
const fileInput = document.getElementById('loadfile');