Giter Site home page Giter Site logo

niklasfasching / go-org Goto Github PK

View Code? Open in Web Editor NEW
340.0 340.0 49.0 1.64 MB

Org mode parser with html & pretty printed org rendering. also shitty static site generator.

Home Page: https://niklasfasching.github.io/go-org/

License: MIT License

Makefile 0.91% Shell 3.46% Go 93.57% CSS 2.06%
emacs go org-mode static-site

go-org's People

Contributors

anthonyfok avatar bep avatar dependabot[bot] avatar facundoolano avatar fikrirnurhidayat avatar fpdotmonkey avatar glacials avatar josephburnett avatar juneezee avatar kisaragi-hiu avatar leenzhu avatar linchen2chris avatar niklasfasching avatar obar avatar pjkundert avatar prmadev avatar qulogic avatar xjzi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

go-org's Issues

[question] does it support one org mode file generate multiple posts

With Ox-Hugo, I can achieve subtree based approach where each level one heading subtree will become a separate post.

If I don't use Ox-Hugo and utilize this plugin, Is it possible to achieve the same? Went through the documentation, didn't find anywhere mentioned this. Maybe it's not possible, but just want to confirm.

What am I doing wrong? I can't get netlify to work with .org files

While hugo renders my website written with .org files perfectly locally, I cannot get things to work at all with netlify:

  • using .md files, everything works on netlify
  • using .org files, the deployment is successful, but none of the code blocks, links, etc. get rendered (they are shown verbatim)

I don't think that it is a question of hugo version because I created a netlify.toml file with:

[build]
  publish = "public"
  command = "hugo"

[context.production.environment]
  HUGO_VERSION = "0.63.2"

This may not be the proper place to ask about this as it likely is not a go-org problem but a netlify question... If so, don't hesitate to close this and I will ask in the netlify forum.

lines interpreted as comments

It seems that go-org interprets all lines matching "^\s*#" as comments. That has two flaws, one straight-forward, one a bit more subtle:

  1. Org Mode only treats "^\s*#\s" lines are comments.

  2. In special blocks like BEGIN_CENTER (same w/ SRC, VERBATIM etc), there are no such comments. I am not sure how this is handled, and exactly what blocks are affected etc.

go-org should parse simple timestamps in the DATE header

When using go-org with Hugo, it would be nice to have support for Org timestamps for the DATE header.

At the moment (hugo v0.72.0), DATE only supports Hugo's native syntax in Org files, therefore this is parsed correctly:

#+DATE: 2020-06-10

While this is not:

#+DATE: <2020-06-10 Wed>

Expected result

Using the following template to format a page's Date attribute should produce the correct date:

{{ dateFormat "January 2, 2006" .Date }}

Actual result

Output for #+DATE: 2020-06-10:

June 10, 2020

Output for <2020-06-10 Wed>:

January 1, 0001

It would be great if go-org could add support for simple Org timestamps in the DATE header so that tools such as Hugo can parse standard Org file dates (such as those inserted by org-export-insert-default-template) correctly.

Inline html not working in front matter

Hello,

While exporting org to html, front matter elements such as #+title can process inline html code padded with @@html:. But this does not seem to work in Hugo.

For instance, this works in "regular" .org to .html export to add a line break inside the title:

#+title: My first title part: @@html:<br>@@ my second part on the line below

You can even make it more fancy by customizing elements of a title if you want one file to be different than what is set in the css file:

#+title: @@html:<span style="font-size:33px">@@My first title part with custom size: @@html:</span><br>@@@@html:<span style="font-size:28px">@@Fmy second part on the line below with another custom size @@html:</span>@@

In Hugo however, all of the raw html is exported verbatim.

Would it be possible to have rendering within the front matter or would this be nightmarish to implement???

Thank you!

Will the org front matter support some structure like an associative array?

First of all, thanks very much for your development to support our emacs org-mode users to use Hugo more conveniently.
I'm comfortable writing Hugo posts via org now, but I'm a little bit confused about the handling of the associative array.

For example, if there is a YAML front matter like this,

title: an amazing title
tags:
- tag1
- tag2
menu:
  example:
    parent: Example Topic
    weight: 1

About the keys of title and tags, if write them by org matter, they will be,

#+title: an amazing title
#+tags[]: tag1 tag2

However, how to handle the following YAML matter which contains some structure like an associative array through org matter?

menu:
  example:
    parent: Example Topic
    weight: 1

I tried some combinations that didn't seem to work. Is there any good way to solve it?

Table of content markup support

Hi!

I am using org-mode in Hugo and I am unable to select the number of header levels in the TOC.

In my config.toml, I have:

[markup]
  [markup.tableOfContents]
    endLevel = 1
    ordered = false
    startLevel = 1

And, if I write my content in markdown, I do have one level of header in my TOC (as expected). But if I use org-mode, I have 3 levels.

Since org-mode does not seem to take the config.toml into effect for the TOC, I tried to play with classic org-mode options (which is probably very naive) by adding #+OPTIONS: toc:1 or #+toc: 1 in the front matter, but nothing seems to have any effect.

Is this not supported (and if so, could I suggest it as a request?) or am I doing something wrong?

Should I post this on the hugo repo instead?

Thanks! and thanks for the project πŸ™‚


Hugo Version: 0.62.2

Codeblock directives ignored

This is a repost from one I opened at hugo as I was directed to open it here:

What version of Hugo are you using (hugo version)?

$ hugo version
Hugo Static Site Generator v0.65.3-211BA42A/extended linux/amd64 BuildDate: 2020-02-23T10:07:00Z

Does this issue reproduce with the latest release?

Yes

Issue

Orgmode source code blocks have header directives that control what is exported as described here. Hugo is ignoring the directives (which effectively means that all source code blocks have :exports both (exporting source code and results). For example, this block

#+BEGIN_SRC ipython :exports none
print("Shouldn't export anything")
#+END_SRC

shouldn't export anything, but instead Hugo exports the codeblock and the results text "Shouldn't export anything". A screenshot of the output:
hugo exports

As alluded to in the original hugo issue, I understand this may be too much to take on.

Newline at beginning and end of paragraphs in verse and quote blocks.

Consider the following block:

#+begin_verse
User: I am unhappy.
ELIZA: DO YOU THINK COMING HERE WILL HELP YOU NOT TO BE UNHAPPY
#+end_verse

go-org produces this markup:

<div class="verse-block">
<p>
User: I am unhappy.
ELIZA: DO YOU THINK COMING HERE WILL HELP YOU NOT TO BE UNHAPPY
</p>
</div>

This causes extra vertical space when white-space: pre rule is applied.

It would be better for it to return:

<div class="verse-block">
<p>User: I am unhappy.
ELIZA: DO YOU THINK COMING HERE WILL HELP YOU NOT TO BE UNHAPPY</p>
</div>

lists include following higher-level headings

Hi,

this bug came up in my first tests with Hugo. Here's a test case showing the wrong behavior. Basically everything I have to say is in the snippet itself:

#+title: Test List-Heading Interaction

* Heading 1
- any plain list item
** Heading 2 (the list should have ended already)
BUT in fact it is still a part of the last item in the generated HTML.

* preconditions of the bug
- heading after the list is at higher level with respect to heading
  before the list
- independent of
  - TODO status
  - newlines

Thanks for your attention!

[Feature request]: image-links

Thanks for go-org πŸ™‚ It is really great!!

One feature that org-mode is missing and which is particularly nice for websites is to have hyperlinks on images. Markdown allows this with [![alt text](image path)](url).

The ox-hugo package managed to implement this (see for instance here) and I was wondering how easy/difficult it may be to implement it in go-org.

Thank you!

[Bug] Issues with org tables

I am having 2 kinds of issues when creating org tables for Hugo:

  • Horizontal lines are created at each line break (even when there is no separating line in the org table and those lines should be in the same raw)

Example:

This:

2020-06-19_22:44:17

Is creating this:

2020-06-19_22:45:03

Example:

This:

2020-06-19_22:45:18

Is exported into this:

2020-06-19_22:45:30

I looked at the table section in the .scss of the Hugo theme I am using and there isn't anything in it that should be causing this (I think).

Thanks for the package!!

Bug: headers are one level too low

By playing with equivalent .org and .md files, I realized that headers are one level too low with .org files:

With .org files

* First level header

gets rendered as a 2nd level, while in .md files

# First level header

gets properly rendered as a 1st level.

Same thing for all other levels (2nd level gets rendered as a 3rd, etc.)

better support for inline footnotes without labels

A few things I found while rewriting Goorgeous:

This footnote should be handled:

This is another footnote, but defined inline without a label. [fn::This is the *inline that contains bold text* definition of this footnote]
This is a line with a footnote.[fn:1]
This is a line with a footnote.[fn:foo_bar]

This is another footnote, but defined inline with a label. [fn:2:This is the inline definition of this footnote]

[fn:1] this is a footnote with a [[https://chaseadams.io][link]] and *bold /italic =code=/* text.
[fn:foo_bar] this is a footnote with a [[https://chaseadams.io][link]] and *bold /italic =code=/* text.

(org-html-export-as-html) converts named labels to numbers so that the above renders as:

<p>
This is a line with a footnote.<sup><a id="fnr.1" class="footref" href="#fn.1">1</a></sup>
</p>

<p>
This is a line with a footnote.<sup><a id="fnr.2" class="footref" href="#fn.2">2</a></sup>
</p>

<p>
This is another footnote, but defined inline with a label. <sup><a id="fnr.3" class="footref" href="#fn.3">3</a></sup>
</p>
<div id="footnotes">
<h2 class="footnotes">Footnotes: </h2>
<div id="text-footnotes">

<div class="footdef"><sup><a id="fn.1" class="footnum" href="#fnr.1">1</a></sup> <div class="footpara"><p class="footpara">
this is a footnote with a <a href="https://chaseadams.io">link</a> and <b>bold <i>italic <code>code</code></i></b> text.
</p></div></div>

<div class="footdef"><sup><a id="fn.2" class="footnum" href="#fnr.2">2</a></sup> <div class="footpara"><p class="footpara">
this is a footnote with a <a href="https://chaseadams.io">link</a> and <b>bold <i>italic <code>code</code></i></b> text.</p></div></div>

<div class="footdef"><sup><a id="fn.3" class="footnum" href="#fnr.3">3</a></sup> <div class="footpara">This is the inline definition of this footnote</div></div>


</div>

Personally, I'm not a fan of this, but if you want to emulate what org-mode is doing, you'll have to keep your own list of footnote links as numbers (not the named labels).

Line breaks may cause unexpected spaces in Asia languages

When converting org to html, the line breaks are also preserved in html. This is not an issue for western languages, but may insert unexpected spaces for Asia languages, e.g., Chinese, in some browsers.

See the example below.

bug

The converted html code is as follows.

<p>中午
吃ε•₯</p>

The space is caused by the line break. Note that some browsers will not insert the spaces, while others insert annoying spaces.

Is there a way to let go-org omit such line breaks during the converting?

can not forbid code exporting

#+begin_src plantuml :file images/osi_layer.png :cmdline -charset utf-8 :exports results
....
#+end_src

:exports doesn't work and always export the code.

Long links

I have some long links that I would like to wrap somehow. I posted on the
Org Mode mailing list and it was suggested I could use angle brackets:

[fn:23] Plain URIs are recognized only for a well-defined set of schemes. See
External Links. Unlike URI syntax, they cannot contain parenthesis or white
spaces, either. URIs within angle brackets have no such limitation.

https://github.com/bzg/org-mode/blob/master/doc/org-manual.org#footnotes

Like this:

<https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/
String/lastIndexOf>

or link abbreviations like this:

#+LINK: js https://developer.mozilla.org/docs/Web/JavaScript/Reference/

[[bugzilla:Global_Objects/String/lastIndexOf]]

https://gnu.org/software/emacs/manual/html_node/org/Link-abbreviations

However neither of these methods seem to work with Go-Org:

$ cat sunday.org
<https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/
String/lastIndexOf>

#+LINK: js https://developer.mozilla.org/docs/Web/JavaScript/Reference/

[[js:Global_Objects/String/lastIndexOf]]

$ go-org sunday.org html
<p>
&lt;https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/
String/lastIndexOf&gt;
</p>
<p>
<a href="js:Global_Objects/String/lastIndexOf">js:Global_Objects/String/
lastIndexOf</a>
</p>

❀️Thanks for go-org

No real issue, just wanted to say thanks for writing this @niklasfasching! After reading the source, It's 10x better than what chaseadamsio/goorgeous was, is a lot easier to reason about and will be a big help to Hugo!

Org file links converted to links to another post

So, I have an .org file with a link to another .org file, in the same content folder.

in post-1.org:
[[file:another-post.org][another post]]

when the HTML is processed,

the HTML link directs to

localhost:1313/post/post-1/another-post.org

but it would be nice to have a file link converted to link to another post.

localhost:1313/post/another-post

Any easy workaround for this issue?

html escaping of literal example

#+BEGIN_EXAMPLE

line 1,"<any"
line 2

#+END_EXAMPLE

is incorrectly transformed to

<pre class="example">
line 1,"<any" line="" 2="" <="" pre="">
</any"></pre>

and brower takes '<any' as an html tag.

better support for src blocks

Source blocks with a language defined should render the language in the class:

#+BEGIN_SRC javascript
console.log("hello world!")
#+END_SRC

output from (org-html-export-as-html):

<pre class="src src-javascript">console.log(<span style="color: #7EFDD0;">"hello world!"</span>)
</pre>

how to use?

$ ./go-org org blorg build
Unsupported command: org

$ ./go-org blorg build
Error: lstat content: no such file or directory

$ ./go-org blorg serve
2021/01/18 20:45:50 listening on: :3000
2021/01/18 20:46:03 lstat content: no such file or directory

$ ./go-org blorg build
Error: lstat content: no such file or directory

Possibility to overnight writer methods

Currently it is impossible to override HTML writer methods to fine-tune them. For Gitea project we need custom link/image URLs but only way to implement this is to copy all HTML writer and change single method. Mostly it is because of nodeAsString method that clones writer and also WriteNode usage that passes HTML writer all over the place

Org mode reference

In your README (happy to see that you adopted README.org instead of README.md :)), you list an Org mode mirror as reference.

In fact the official repo is equally accessible. The master branch as of today is the soon-to-be-released Org 9.2. The maint branch is the current latest stable Org 9.1.x.

Footnote formatting

The structure and formatting of footnotes generated by go-org is quite different to those generated by Blackfriday. As a result, hugo themes that apply styling to Blackfriday footnotes don't work very well with org-mode content. (I also happen to think the Blackfriday style looks nicer, but that's not particularly relevant.)

Would you be open to accepting a pull request that changes footnote output to match Blackfriday?

The <pre> tag around the highlight div maybe shouldn't be added

According to this commit 37d33c1 , A <pre> was added around the <div class="highlight"> , this cause the code block in my site looks ugly (check the comment for that commit ,there are some images). After some investigation, finally I found the reason why this happen.

Copy from https://www.w3schools.com/tags/tag_pre.asp

<pre>
Text in a pre element
is displayed in a fixed-width
font, and it preserves
both      spaces and
line breaks
</pre>

This is the html source generated by go-org, the line breaks will be preserved inside this tag, include the line break after every tags inside this block. So there will be 4 empty lines before and after the codes.

<pre class="src src-text"><div class="highlight"><div style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4">
<table style="border-spacing:0;padding:0;margin:0;border:0;width:auto;overflow:auto;display:block;"><tbody><tr><td style="vertical-align:top;padding:0;margin:0;border:0;">
<pre style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-text" data-lang="text"><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">1
</span></code></pre></td>
<td style="vertical-align:top;padding:0;margin:0;border:0;">
<pre style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-text" data-lang="text">$ celery -A proj beat</code></pre></td></tr></tbody></table>
</div>
</div>
</pre>

styling of verse

Hello!

I'm evaluating this parser to see how does it compare with ox-hugo and noticed e.g. the difference of handling org-mode's verseenvironment, iow. if I have the following content:

#+BEGIN_VERSE
 Great clouds overhead
 Tiny black birds rise and fall
 Snow covers Emacs

    ---AlexSchroeder
#+END_VERSE

the generated code for it is:

<div class="verse-block">
<p>
Great clouds overhead
Tiny black birds rise and fall
Snow covers Emacs
</p>
<p>
β€”AlexSchroeder
</p>
</div>

which looks like this:

go-org

However, the same example when converted to Blackfriday's markdown produces:

<p class="verse">
Great clouds overhead<br />
Tiny black birds rise and fall<br />
Snow covers Emacs<br />
<br />
&nbsp;&nbsp;&nbsp;---AlexSchroeder<br />
</p>

which is rendered as:

ox-hugo

I did test it with Hugo Static Site Generator v0.58.3/extended linux/amd64 BuildDate: 2019-10-09T08:55:21Z being reluctant to switch to 0.60 considering I'm not sure how will ox-hugo handle switch to Goldmark markdown parser.

Any hint?

Lists wrap items in <p> tags

Perhaps this observation isn't an 'issue' as the current behavior is accounted for in the tests, but the processing of lists is different in go-org than it is in an org export to HTML: it adds <p> tags around list items, where org export does not. Is it possible/does it make sense to catch the cases when the list item should be a paragraph within WriteListItem (I'm not sure what those cases are), and otherwise write the item as a string? Below is a simple example.

Sample input

- this is a list
- another point

org-mode export output

<ul>
<li>this is a list</li>
<li>another point</li>
</ul>

(actually it adds a org-ul class by default)

go-org output

<ul>
<li>
<p>this is a list</p>
</li>
<li>
<p>another point</p>
</li>
</ul>

[Question] Using multiple words in string lists

Thanks for developing go-org. It is great to write websites directly in Org Mode with a conversion step.

Question: lists are separated by whitespace, which leads to some unwanted behaviour, e.g.

#+tags[]: Data Science creates two tags, "Data" and "Science".

In Markdown Hugo you can use spaces in lists. Hugo adds a dash when creating a slug.

I created a workaround in my theme where I use a dash in the list. Whenever I display the tag name, I replace the dash with a space: {{ replace . "-" " " }}

Question: Is there a way to use multiple-word tags in go-org without workaround?

Add support for escaping in literal examples

Sometimes you have to escape source code or examples otherwise they will be interpreted as outlines nodes or some other special syntax, see the documentation on literal examples.

The documentation explains this with the following example. Notice the comma to escape the fake headline. If it wasn't escaped org-mode would interpret it as a real headline.

#+BEGIN_EXAMPLE
,* I am no real headline
#+END_EXAMPLE

If you edit the example in Emacs with C-c ' the escaping character will be inserted automatically.

However on export you want the escaping character to be gone.

I have added some test data to the test files to illustrate the issue.
org/testdata/blocks.org

#  Escaping in literal examples, see
#  https://orgmode.org/manual/Literal-Examples.html#Literal-Examples
#+BEGIN_EXAMPLE
  ,* I am no real headline
#+END_EXAMPLE

org/testdata/blocks.pretty_org

#  Escaping in literal examples, see
#  https://orgmode.org/manual/Literal-Examples.html#Literal-Examples
#+BEGIN_EXAMPLE
  ,* I am no real headline
#+END_EXAMPLE

org/testdata/blocks.html

<pre class="example">
   * I am no real headline
</pre>

better support for headlines

Headlines should not render the action status, priority or labels as a part of the text:

* TODO [#A] title :label:label1:label_2:label-3:

output from (org-html-export-as-html):

<h2 id="org784dbb5"><span class="section-number-2">1</span> title</h2>

How to get inline markup to work?

Is inline highlighting supported? (My apologies if the information is already posted somewhere.)

With markdown, inline highlighting is possible with backticks.

In regular org export, it can be achieved with src_lang{text} or src_lang[:eval no]{text}. But this does not seem to work here (this code gets exported verbatim).

Similarly, to get custom inline formatting in markdown, it is possible to insert inline raw html:

Some text <span style=xxxx>custom formatted text</span>.

In regular org export, inline html works with the @@ syntax, so this works:

Some text @@html:<span style=xxxx>@@custom formatted text@@html:</span>@@.

But in Hugo, this is also rendered verbatim.

Am I missing something? is this not supported? if so, are there workarounds?

Thank you!!!

Class before heading tags, is it possible?

Hello,

I am not very experienced with CSS. I would like to achieve two things:

  • The .outline-3:hover CSS effect on headings 3 and beyond as it appears on this site
  • The anchors on each heading on the same link.

As you can see, the headings are wrapped with a class before the heading itself but I don't see this structure as parsed with go-org; so I was wondering if there is any sort of configuration for this?

Regarding the anchors after each heading there is an anchor tag class with the link and style. I noticed that by adding a custom id on org mode I can link to a header, however the header doesn't have an anchor itself, only an id name. Is there a way to achieve something similar as on this site?

I am using Hugo, and since it uses go-org, I thought it was appropriate to ask here to check if it is feasible.

Thank you very much.

Bad include

Using this file:

#+INCLUDE: "app.php" src php

I get this result:

WARN 2019/09/09 23:04:11 Bad include
org.Keyword{Key:"INCLUDE", Value:"\"app.php\" src php"}:
open autumn\app.php: The system cannot find the path specified.

Using this file:

#+INCLUDE: "autumn\app.php" src php

I get this result:

WARN 2019/09/09 23:05:23 Bad include
org.Keyword{Key:"INCLUDE", Value:"\"autumn\\app.php\" src php"}:
open autumn\autumn\app.php: The system cannot find the path specified.

Displaying shortcodes as text

I am writing a blog post about using Org Mode and want to insert this bit of source code:

#+begin_src org
[[{{< ref filename.org >}}][link title]]
#+end_src

When I compile this page, Hugo throws an error because it resolves the link and complains it does not exist. When I add an existing filename, the shortcode is rendered to the URL.

How can I show this code on the page without the shortcode being resolved by Hugo?

Subscript and superscript in LaTeX fragments

When a subscript or a superscript appears in a LaTeX fragment, it should remain untouched so that MathJax or KaTeX can process them. But currently, if a subscript or a superscript presents in a LaTeX fragment, it will be rendered with a <sub> or a <sup> tag, making it impossible for MathJax to process.

Example code:

Example code: \(\sum_{i=1}^n a_n\)

Output

<p>
Example code: \(βˆ‘<sub>i=1</sub>^n a_n\)
</p>

Internal links not supported?

According to org docs https://orgmode.org/manual/Internal-Links.html#Internal-Links, I can create internal links to a different section via [[* Section Name][link text]] (also without the asterisk sometimes). However, this simple example fails:

* Hello World

[[* Hello World][link]]

This generates <a href="* Hello World">link</a> with the online demo (and also in gitea, but with a full path). However, emacs exports something like this:

<h2 id="org41633b5"><span class="section-number-2">1</span> Hello World</h2>
<div class="outline-text-2" id="text-1">
<p>
<a href="#org41633b5">link</a>
</p>
</div>

Based on #32, dedicated targets doesn't work either, nor does the #+NAME: example from the org documentation. It looks like only using CUSTOM_ID and [[#id][...]] works, but that's pretty verbose for simple use-cases.

State of parsing of TODOs

Hello,

I'm writing a tool which would need to get a list of all the TODO items in a set of org files, as well as some metadata around them.
e.g: tags, priorities, property drawer values

I was wondering if this parser deals with such things, or is it more for html export?

I did see this parser which seems to quite nicely have gone the EBNF route, but I really wanted to use Go for my project!

Thanks

Please tag a release

So that hugo can depend on that instead of a random commit, and to help with downstream packaging.

Problem with internal links and the ref shortcut

Internal links stopped working (Hugo version: hugo v0.81.0+extended linux/amd64 BuildDate=unknown).

I use {{< ref filename.org >}} for internal links. For some reason, Hugo now adds ../ to the front of the HTML link.

{{< ref filename.org >}} resolves properly to https://baseurl/filename/

But when I surround it with square brackets, it goes wrong:

[[{{< ref filename.org >}}][link text]] resolves to ../https://baseurl/filename/.

Everything works fine when using Markdown.

Parsing latex formula error when `+` or `-` followed by a space exists in the begining of lines in math environment

When we write a long formula in latex, I always break it into several lines, like this

\begin{equation}
a = b
+ c               %% There is a space after `+`
\end{equation}

The line with + c will be recognized as a list other than part of the formula, which results in the wrong results.

The following two cases will work well

  • move the + to the end of the last line
    \begin{equation}
    a = b + 
    c
    \end{equation}
    
  • delete the space after +
    \begin{equation}
    a = b
    +c
    \end{equation}
    

Ugly behavior of PrettyRelativeLinks

I have a problem with referring my image files with Hugo.
I tried Hugo with the following files.

$ hugo version
hugo v0.83.0-DEV+extended

(It uses go-org v1.4.0.)

content
β”œβ”€β”€ _index.org
β”œβ”€β”€ test-branch
β”‚   β”œβ”€β”€ _index.org (*1)
β”‚   β”œβ”€β”€ content1.org (*2)
β”‚   β”œβ”€β”€ content2.org
β”‚   └── test.png
└── test-leaf
    β”œβ”€β”€ index.org  (*3)
    └── test-leaf.png

The problem is:

  • (*1) To refer test.png correctly I must write [[./test-branch/test.png]], because [[./test.png]] will be converted as <img src=".././test.png" alt=".././test.png" title=".././test.png" />. I think it is ugly.
  • (*2) To refer test.png, you should write [[./test.png]]. (It might be intuitive but...)
  • (*3) Same as (*1)

Furthermore, to refer content2.org you should write [[./content2]] in content1.org (*2) but [[test-branch/content2]] in _index.org (*1), though these files are in the same directory.
(And for the files in content/ it might be even worse, especially the top URL is not / (e.g. https://example.com/hugo/ instead of https://example.com/).)

I think this behavior of the PrettyRelativeLinks is very ugly and harmful for users.

For (*1) and (*3) I want to write [[./test.png]] so I don't have to change anything when I change the name of the directory, even if I have to write [[../test.png]] for (*2).

FYI: With .md files:

  • (*1) To refer test.png, you should write ![Alt text](./test.png "a title"). (of course)
  • (*2) To refer test.png, you should write ![Alt text](../test.png "a title"). (../ instead of ./)
    It might not be intuitive, but understandable, because the URL for content1.md is .../test-branch/content1/.
  • (*3) To refer test-leaf.png you should write ![Alt text](./test-leaf.png "a title"). (of course)

I think this behavior is reasonable.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.