Skip to content

Commit

Permalink
Documentation and resoning
Browse files Browse the repository at this point in the history
  • Loading branch information
FelipeSimoes committed Jan 2, 2024
1 parent 1e618b9 commit ca59b83
Showing 1 changed file with 46 additions and 1 deletion.
47 changes: 46 additions & 1 deletion docs/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ This simply resume into 2 things
1 - docs into HTML
2 - Excel / spreadsheets into JSON

### Docs into HTML
### Docs into HTML - Server side render

A simple doc file with a Example text will be rendered into something like

Expand Down Expand Up @@ -48,6 +48,51 @@ A simple doc file with a Example text will be rendered into something like
</html>
```

It renders the Docs into HTML like the example:

Here's a example document
![Example doc](assets/doc-example.png)

This will be transform into this apart from the HTML exampled above:

```
<div>
<p>Normal text</p>
<h1 id="title">Title</h1>
<h3 id="sub-title">Sub title</h3>
<h2 id="heading-2-asdkjasdlkja-asldkaslkdjasdlkasjd-alksdj-alksd-aslk">Heading 2 asdkjasdlkja asldkaslkdjasdlkasjd alksdj alksd aslk</h2>
<h3 id="heading-3">Heading 3</h3>
<h4 id="heading-4">Heading 4</h4>
<h5 id="heading-5">Heading 5</h5>
<h6 id="heading-6">Heading 6</h6>
<div class="table-heading-1">
<div>
<div>Table row 1 col 1</div>
<div>Table row 1 col 2</div>
<div>Table row 1 col3</div>
</div>
<div>
<div>Table row 2 col 1</div>
<div>Table row 2 col 2-3</div>
</div>
</div>
<p><a href="https://www.w3schools.com/html/html_links.asp">This is a link example</a></p>
</div>
```

So we can resume the server side render into this simple rules:

1 - Title formating are H1
2 - Sub title formating are h3
3 - All other headings follows the proper name - element correlation
4 - All headings will be attached a ID based on it's content
5 - Tables will render one and only header as a classname, lowercase dash separated
6 - Tables rows will create one div per column
7 - Tables will be only rendered as <table> when inside another table
8 - You can wrapp a div by adding a --- into the document
9 - Breaklines are <p>
10 - Links most of the time, are wrapped into <p> tags then a <a>

That way we have a clean simple way to generate HTML and JSON based on documents and document trees

With some OOB exceptions are also included like
Expand Down

0 comments on commit ca59b83

Please sign in to comment.