question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Inline template-replacement

See original GitHub issue

There is another question I have according to your plans for the output rendering, The output can be precised defined by a template like Handlebars or Mustache.

An output template will look like

## {{title}}

in Markdown,

\subsection{ {{title}} }

in LaTeX

<h2>{{title}}</h2>

in HTML.

Basic principle of template engine:

  • use a template for generation of a compiler function ast4title. (only once)
  • multiple applications of this compiler function with different JSON ast4title('html',pMyTitle,pOptions).
  • pMyTitle is a JSON that contains the title in pMyTitle.title. The string value of title will be replaced by the compiler in the template of the output language html,
  • the compiled output will be return from the function my_title_in_html = ast4title('html',pMyTitle,pOptions).
  • The first parameter defines the output format. Iterations over lists are possible with these template engines foreach (see Handlebars https://handlebarsjs.com/builtin_helpers.html ) . Does it make sense to you to reduce your work for output rendering for wtf_wikipedia by using the handlebars or other template engines by requiring those NPM modules in wtf_wikipedia? Those templates defined the output node handlers for the Abstract Syntax Tree (AST), similar to want you are currently doning in src/output.

This comment might be irrelevant, if you have e.g. some performance befefits from implementing that in the way to have planed it currently in the dev-branch.

Best regards with great appreciations for your work for refactoring wtf_wikipedia

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
niebertcommented, Jan 28, 2019

Depended on the library or format in which the math expressions are rendered, the HTML export will look different toHTML.js. We should create a folder src/math that is reponsible for handling math expressions.

Yes as recommended in the wiki, If you alter the wiki recommendation in way that is OK for you, then I will follow that route of implementation and support you. Would recommend to convert the results of discussion in issues into a proposal for implementation in the wiki, that will serve as guideline for all developers that support you. At the same time we have the documentation ready. Use the MathJax syntax for rending math expression as output. With MathJax we can preserve the LaTeX math in HTML output without any need to alter the provide math expression. See MathJax in Wiki

0reactions
spencermountaincommented, Mar 12, 2020

as of v8 our 4 output formats have been split-out into plugins, which may help in your work in wikiversity. Let me know if there’s anything I can do.

Read more comments on GitHub >

github_iconTop Results From Across the Web

C++ template and inline - Stack Overflow
What would happen if the inline is a qualifier for a function template, which is not a member of a class? Is inline...
Read more >
Inline template steps - options for batch execution - IBM
This field contains the executable code that is run by the step. It is possible to use variable substitution in this field. To...
Read more >
Defining Inline and External Templates, and Using Relative ...
Instead of template , we have used templateUrl , and we replaced styles with styleUrls . These changes are essential because both properties ......
Read more >
Vue 3.0 - default slot as replacement for inline-template
JS ; 1. const app = Vue.createApp({}); ; 2. ​ ; 3. app.component("test-default-slot", { ; 4. template: '<slot v-bind="self"/>', ; 5. computed: {....
Read more >
Replace iframe inline template with an actual template - Drupal
For the purpose of code cleanliness, replace the inline template used for generating the iframe with an actual template.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found