#84 Org files don't display how they should

Open
opened 1 week ago by rmw · 11 comments
rmw commented 1 week ago
Org-file on codeberg: https://codeberg.org/rmw/devuan-debootstrap-scripts/src/branch/master/README.org Org-file on gitlab (has image issues): https://gitlab.com/RobinWils/devuan-debootstrap-scripts/blob/master/README.org Org-file on github (works like it should): https://github.com/Robin-Wils/Devuan-Debootstrap-Scripts/blob/master/README.org
hw commented 1 week ago
Owner

What file format is this? Plain markdown?

What file format is this? Plain markdown?
hw added the
gitea-related issue
label 1 week ago
rmw commented 1 week ago
Poster

No, org. It is something even more powerful (in my opinion). Some people use GNU Emacs only for that mode. It is extremely useful to manage stuff. I am even planning on using it to generate my website. It just works fast and great.

GNU Emacs is not required for org. Anyway, you can convert the text-file to almost anything (a couple of the export options are: powerpoint, PDF, LaTeX, HTML, Markdown,…). The point is it is powerful and there are enough people who use it. I prefer it over Markdown in most cases.

Org-mode: https://orgmode.org

No, org. It is something even more powerful (in my opinion). Some people use GNU Emacs only for that mode. It is extremely useful to manage stuff. I am even planning on using it to generate my website. It just works fast and great. GNU Emacs is not required for org. Anyway, you can convert the text-file to almost anything (a couple of the export options are: powerpoint, PDF, LaTeX, HTML, Markdown,...). The point is it is powerful and there are enough people who use it. I prefer it over Markdown in most cases. Org-mode: https://orgmode.org
hw commented 1 week ago
Owner

We can register custom markup renderers in Gitea’s app.ini config section [markup.*]. If you like to contribute an example config, we are happy to enable it!

For an example, please see https://codeberg.org/Codeberg/gitea/src/branch/master/custom/conf/app.ini.sample

We can register custom markup renderers in Gitea's app.ini config section [markup.*]. If you like to contribute an example config, we are happy to enable it! For an example, please see https://codeberg.org/Codeberg/gitea/src/branch/master/custom/conf/app.ini.sample
rmw commented 1 week ago
Poster

I have no experience with that, and wouldn’t know how to make such a file.

I will mention it on the Fediverse (free software social media). Someone there has a gitea and it looks like that person has some org support, not all, but it would be a start.

I have no experience with that, and wouldn't know how to make such a file. I will mention it on the Fediverse (free software social media). Someone there has a gitea and it looks like that person has some org support, not all, but it would be a start.
hw commented 1 week ago
Owner

This would be the relevant section, … the most tricky part probably figuring out the command line tool to convert orgmode files to html stdout (possibly via pandoc instead of the asciidoc example below, or do other tools produce better output?):

[markup.asciidoc]
ENABLED = false
; List of file extensions that should be rendered by an external command
FILE_EXTENSIONS = .adoc,.asciidoc
; External command to render all matching extensions
RENDER_COMMAND = "asciidoc --out-file=- -"
; Don't pass the file on STDIN, pass the filename as argument instead.
IS_INPUT_FILE = false
This would be the relevant section, ... the most tricky part probably figuring out the command line tool to convert orgmode files to html `stdout` (possibly via `pandoc` instead of the `asciidoc` example below, or do other tools produce better output?): ``` [markup.asciidoc] ENABLED = false ; List of file extensions that should be rendered by an external command FILE_EXTENSIONS = .adoc,.asciidoc ; External command to render all matching extensions RENDER_COMMAND = "asciidoc --out-file=- -" ; Don't pass the file on STDIN, pass the filename as argument instead. IS_INPUT_FILE = false ```
rmw commented 1 week ago
Poster

There are libraries which can parse it, pandoc is indeed one of them.
https://orgmode.org/worg/org-tools/index.html

pandoc -f org -t markdown or pandoc -f org -t html should work.

There are libraries which can parse it, pandoc is indeed one of them. https://orgmode.org/worg/org-tools/index.html `pandoc -f org -t markdown` or `pandoc -f org -t html` should work.
rmw commented 3 days ago
Poster

Did anyone try to implement that command?
The problem is not solved yet.

Did anyone try to implement that command? The problem is not solved yet.
hw commented 17 hours ago
Owner

The codeberg-test is configured with the above command, images are not properly rendered (relative path not working?), and style could need some improvement. (Would you like to contribute?)

Also we’d like to have learn more about the orgmode format, in order to have a proper understanding of security implications. It’s work-in-progress at this point in time: https://codeberg-test.org/hw/devuan-debootstrap-scripts

The `codeberg-test` is configured with the above command, images are not properly rendered (relative path not working?), and style could need some improvement. (Would you like to contribute?) Also we'd like to have learn more about the orgmode format, in order to have a proper understanding of security implications. It's work-in-progress at this point in time: https://codeberg-test.org/hw/devuan-debootstrap-scripts
hw removed the
gitea-related issue
label 17 hours ago
hw commented 17 hours ago
Owner

Some observations:

  • Pandoc supports HTML templates. This might be a useful option to beautify and style the output. (And would be reusable for rendering all other pandoc-supported formats, RST, OpenOffice, …, PDF, Notebooks, …). Contributions welcome!
  • The relative-path problem is rooted in the fact that pandoc creates a relative path, but the relative path to the document points to the HTML with gitea’s UI having the picture embedded. We need to figure out some way to build an absolute path to the raw image link.

What might be the best way to achieve this?

As this might be useful as general interface to Gitea-renderers, cc: @kolaente , do you know if there is some ‘proper’ way to implement this?

Some observations: - Pandoc supports HTML templates. This might be a useful option to beautify and style the output. (And would be reusable for rendering all other pandoc-supported formats, RST, OpenOffice, ..., PDF, Notebooks, ...). Contributions welcome! - The relative-path problem is rooted in the fact that pandoc creates a relative path, but the relative path to the document points to the HTML with gitea's UI having the picture embedded. We need to figure out some way to build an absolute path to the raw image link. What might be the best way to achieve this? As this might be useful as general interface to Gitea-renderers, cc: @kolaente , do you know if there is some 'proper' way to implement this?
hw commented 15 hours ago
Owner

One more note:

The main question now is where to head for the future -- we could override the built-in parser via pandoc (and get easy support for other formats as side-effect), but then we need to resolve the local/absolute path issue. Alternatively, for an orgmode-only fix, we might just wait for the fix in gitea+go-org.

Any thoughts?

One more note: - Gitea has a built-in orgmode parser, which is failing on your input (shame that we missed this log earlier); thus the output is rendered raw. Also it has other issues: https://github.com/go-gitea/gitea/issues/3122. The main question now is where to head for the future -- we could override the built-in parser via pandoc (and get easy support for other formats as side-effect), but then we need to resolve the local/absolute path issue. Alternatively, for an orgmode-only fix, we might just wait for the fix in gitea+go-org. Any thoughts?
hw added the
gitea-related issue
label 15 hours ago
hw added the
question
label 12 hours ago
rmw commented 10 hours ago
Poster

Depends on what is preferred.

I don’t mind waiting a little for that update. I would, however go for the own implementation if more people need it. Most people probably use markdown and the most important things seem to work (headers and code).

Image support would be cool, but I think that waiting on the update might make it easier to maintain in the future, other users might have a different opinion.

Depends on what is preferred. I don't mind waiting a little for that update. I would, however go for the own implementation if more people need it. Most people probably use markdown and the most important things seem to work (headers and code). Image support would be cool, but I think that waiting on the update might make it easier to maintain in the future, other users might have a different opinion.
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
Cancel
Save
There is no content yet.