We have clarified our Privacy Statement even further. Please have a look at our changes.

#84 Org files don't display how they should

Closed
opened 2 months ago by rmw · 21 comments
rmw commented 2 months 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 2 months ago
Owner

What file format is this? Plain markdown?

What file format is this? Plain markdown?
hw added the
gitea-related issue
label 2 months ago
rmw commented 2 months 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 2 months 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 2 months 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 2 months 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 2 months 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 2 months 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 2 months 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 2 months ago
hw commented 2 months 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 2 months 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 2 months ago
hw added the
question
label 2 months ago
rmw commented 2 months 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.
rmw commented 1 month ago
Poster

Did anyone make the decision yet?

I would like to see at least something working for my org files. I mentioned my opinion in the previous comment.

Did anyone make the decision yet? I would like to see at least something working for my org files. I mentioned my opinion in the previous comment.
hw commented 1 month ago
Owner

No, currently waiting. Please let us know if the text-only (no-images) version deployed on codeberg-test.org seems preferable to the status quo.

No, currently waiting. Please let us know if the text-only (no-images) version deployed on codeberg-test.org seems preferable to the status quo.
rmw commented 1 month ago
Poster

The deployed one no longer seems to work. I personally would go for the gitea parser. It is not perfect, but it might get better in the future.

The deployed one no longer seems to work. I personally would go for the gitea parser. It is not perfect, but it might get better in the future.
hw commented 1 month ago
Owner

ok

ok
hw commented 2 weeks ago
Owner

@rmw : Can you please have another look and update the gitea-related issue if necessary?

@rmw : Can you please have another look and update the gitea-related issue if necessary?
rmw commented 2 weeks ago
Poster

I can’t seem to run the VM. Libvirt is installed, but I get the following error.

I can't seem to run the VM. Libvirt is installed, but I get the following error.
hw commented 2 weeks ago
Owner

@rmw : I meant to ask you to test on the live server https://codeberg.org, or https://codeberg-test.org/.

(does for example https://codeberg.org/rmw/devuan-debootstrap-scripts/src/branch/master/README.org look as intended? The comment section for example seems a bit off, whereas pictures, tables etc seem to look ok?)

@rmw : I meant to ask you to test on the live server https://codeberg.org, or https://codeberg-test.org/. (does for example https://codeberg.org/rmw/devuan-debootstrap-scripts/src/branch/master/README.org look as intended? The comment section for example seems a bit off, whereas pictures, tables etc seem to look ok?)
hw commented 2 weeks ago
Owner

@rmw : The python module for libvirt is part of your distribution (python-libvirt or python3-libvirt on debian-like systems).

@rmw : The python module for libvirt is part of your distribution (python-libvirt or python3-libvirt on debian-like systems).
rmw commented 2 weeks ago
Poster

Ha, this is about the org issue. Yeah that looks much better.

The first few lines don’t display correctly and some *’s which shouldn’t be visible are visible, but the rest is perfect.

I am happy with the current result. The first lines are in a comment section so should be hidden technically.

It is neat that the image displays nicely, which does not happen on Gitlab.

Ha, this is about the org issue. Yeah that looks much better. The first few lines don't display correctly and some *'s which shouldn't be visible are visible, but the rest is perfect. I am happy with the current result. The first lines are in a comment section so should be hidden technically. It is neat that the image displays nicely, which does not happen on Gitlab.
hw commented 2 weeks ago
Owner

closing for now. Please feel free to re-open or open a new ticket if you encounter related issues.

closing for now. Please feel free to re-open or open a new ticket if you encounter related issues.
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.