use the npm i insertion command to download the library you need:
- npm > v6.x
- nodeJs > v12.x
Here's a folder structure for a Simple Project:
my-project/ # Root directory.
|- public/
|- src/
|- components/
|- main.js
|- .babelrc
|- pakage.json
Edit the .babelrc file to set configuration data:
{
"presets": ["react"]
}compiler using
babel yourSourceFolder/ -d yourTargetFolder
Creating a main.js for a project from scratch:
/* @jsx insertionJsx */
import { insertionJsx, Fragment } from "insertion";
import { createElement, mount, render } from "insertion";
import YourComponent from './components/myCoponent.js';
function Main() {
return (
<Fragment>
<YourComponent />
</Fragment>
);
}
let main = createElement(<Main />);
mount(render(main));we recommend using the template for projects
# Introduction
This is the first paragraph of the introduction chapter.
## First
This is the first subsection.
## Second
This is the second subsection.Each title (#) will represent a chapter, while each subtitle (##) will represent a chapter's section. You can use as many levels of sections as markdown supports.
Anchor links can be used to link chapters within the document:
// src/01-introduction.md
# Introduction
For more information, check the [Usage] chapter.
// src/02-installation.md
# Usage
...If you want to rename the reference, use this syntax:
For more information, check [this](#usage) chapter.Anchor names should be downcased, and spaces, colons, semicolons... should be replaced with hyphens. Instead of Chapter title: A new era, you have: #chapter-title-a-new-era.
It's the same as anchor links:
# Introduction
## First
For more information, check the [Second] section.
## Second
...Or, with al alternative name:
For more information, check [this](#second) section.Text. That's cool. What about images and tables?
Use Markdown syntax to insert an image with a caption:
Pandoc will automatically convert the image into a figure (image + caption).
If you want to resize the image, you may use this syntax, available in Pandoc 1.16:
{ width=50% height=50% }Also, to reference an image, use LaTeX labels:
Please, admire the gloriousnes of Figure \ref{seagull_image}.
Use markdown table, and use the Table: <Your table description> syntax to add a caption:
| Index | Name |
| ----- | ---- |
| 0 | AAA |
| 1 | BBB |
| ... | ... |
Table: This is an example table.If you want to reference a table, use LaTeX labels:
Please, check Table /ref{example_table}.
| Index | Name |
| ----- | ---- |
| 0 | AAA |
| 1 | BBB |
| ... | ... |
Table: This is an example table.\label{example_table}Wrap a LaTeX math equation between $ delimiters for inline (tiny) formulas:
This, $\mu = \sum_{i=0}^{N} \frac{x_i}{N}$, the mean equation, ...Pandoc will transform them automatically into images using online services.
If you want to center the equation instead of inlining it, use double $$ delimiters:
$$\mu = \sum_{i=0}^{N} \frac{x_i}{N}$$Here's an online equation editor.
This template uses Makefile to automatize the building process. Instead of using the pandoc cli util, we're going to use some make commands.
Use this command:
make pdfThe generated file will be placed in build/pdf.
Please, note that PDF file generation requires some extra dependencies (~ 800 MB):
sudo apt-get install texlive-latex-base texlive-fonts-recommended texlive-latex-extra Use this command:
make epubThe generated file will be placed in build/epub.
Use this command:
make htmlThe generated file(s) will be placed in build/html.