Skip to content

Commit 5cac725

Browse files
committed
some minor doc fixes
add a proper documentation of the render-pipeline
1 parent cf5d9d5 commit 5cac725

File tree

7 files changed

+26
-8
lines changed

7 files changed

+26
-8
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ So there are some intricacies you should be aware of when working with it and se
8080
Here you can find the technical intricacies of the Obsidian-specific language extension implemented in this project [docs](docs-obsidian.md).
8181
## Permissions
8282
You can specify who is able to read whole files, or only parts of it.
83-
Here you can find more information about [docs-permissions](permissions).
83+
Here you can find more information about [permissions](docs-permissions).
8484
## Technical Details
8585
If you're interested about the software used behind the scenes or some of the URLs you may use to do stuff, then look [here](docs-technical-details).
8686
## Development: Building this Project

docs-building.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Building
22
If you'd like to build and install your own instance of this project, you've come to the right page.
33

4-
[back](README.md) to the main page.
4+
[Back](README.md) to the main page.
55
## How To Build / Update
66
The repository derives from https://github.com/htl-leonding-college/asciidoctor-docker-template and adds functionality to publish the output to a web-server of your liking using DockerHub.
77
It hides (server-side) all pages behind a OIDC token redirecting to an authentication server of your liking (in the default-case it's client on a Keycloak instance linked to our school's AD service, so we never have to maintain the users because the school does this for us).

docs-debugging.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# # Debugging
22
Here you can find help with debugging the project.
33

4-
[back](README.md) to the main page.
4+
[Back](README.md) to the main page.
55
## Debugging
66
To test the portions of the web-site that isn't directly connected to the gh-pages generation and Asciidoc conversion, you may want to start it using VSCode.
77
Just do the following:

docs-keycloak.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Here you find information about the keycloak-setup when you're trying to host it yourself.
22

3-
[back](README.md) to the main page.
3+
[Back](README.md) to the main page.
44
## Keycloak Setup
55
In order for this setup to work correctly, you'll have to have a Keycloak-client (private with secret) and standard-authorization-flow enabled (should be enabled anyway).
66
You need the following user-attributes of type `string` with mapper to the token.

docs-obsidian.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Obsidian Extensions
22
Here you can find the technical intricacies of the Obsidian-specific language extension.
33

4-
[back](README.md) to the main page.
4+
[Back](README.md) to the main page.
55
## Globally Unique File Names
66
Obsidian uses quick-links like so:
77
```markdown

docs-permissions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Permissions
22
Here you can find an explanation of the projects permissions-features.
33

4-
[back](README.md) to the main page.
4+
[Back](README.md) to the main page.
55
## Security
66
To restrict the visibility of a whole file or parts of a document's content and therefore effectively hiding it from anyone not having any of the given roles assigned, you specify a comma-separated list of roles.
77
Anyone who has even one of these roles assigned will be able to view the document or that part of the document you specified the directive for.

docs-technical-details.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Here you find in-depth information about some of the technical background behind the scenes.
22

3-
[back](README.md) to the main page.
3+
[Back](README.md) to the main page.
44
## MD-File Conversion
55
This is done using [marked](https://www.npmjs.com/package/marked) which is installed on the web-server (via `package.json`).
66
With the help of this you can link to any MD-file and show it in the context of your site.
@@ -72,4 +72,22 @@ You can now add the parameter `print-pdf` to the path-string like so:
7272
```bash
7373
https://safelearn.unterrainer.info/md/presentations/test-presentation.md?reveal=true&print-pdf
7474
```
75-
This then renders your RevealJS presentation as a continuous page that you may print as PDF or on whatever printer you have currently installed.
75+
This then renders your RevealJS presentation as a continuous page that you may print as PDF or on whatever printer you have currently installed.
76+
## Render-Pipeline
77+
When you have a look inside the code, you'll find that the file `obsidian.js` prepares a page in a very particular way before it is rendered to HTML-output. Here I want to document that pipeline.
78+
79+
1. File is loaded from disk (`app.js`)
80+
2. Accesstoken is refreshed, so it and all contained roles and attributes are actually current
81+
3. `preParse` is called preparing the content for HTML-conversion
82+
1. `removeForbiddenContent` parses for file- and inline-permissions and removes forbidden parts of the file
83+
2. `preReplacePlantUml` replaces the code tags containing PlantUML-code with a rendered version of it by calling a proper PlantUML conversion service and inserting the SVG of that output here instead of the code-tags
84+
3. `preMarkCode` parses the file for code-marks (cannot be nested) and replaces them for later use of the marks (the content of the code-tags parsed is saved in an array for later insertion)
85+
4. `preReplaceObsidianFileLinks` replaces Obsidian- (or Wiki-) style links with proper links your browser can understand
86+
5. `preMarkCallouts` parses for callouts (may be nested) and replaces their tags inline with appropriate start- and end-tags of our own
87+
6. `unmarkCode` replaces the code-marks by the content of the previously saved array
88+
4. `manipulateHtml` is called actually converting the file
89+
1. `replacePreMarkCallouts` renders the proper callouts pre-marked earlier on
90+
2. `replaceObsidianImageLinks` deals with the Obsidian- (or Wiki-) specific image links (shortform) by expanding that into a proper image-tag
91+
3. `replaceObsidianImageLatResizeValues` deals with the conditional image resizing described in the Obsidian-specific document [here](docs-obsidian)
92+
4. `makeContentMap` generates the map of the files' content later on displayed on the left navbar
93+
5. `DOMPurify.santitize` is called before sending the response to the client

0 commit comments

Comments
 (0)