Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support org spec for #+HTML #19

Closed
kaushalmodi opened this issue Feb 16, 2017 · 8 comments
Closed

Support org spec for #+HTML #19

kaushalmodi opened this issue Feb 16, 2017 · 8 comments
Assignees

Comments

@kaushalmodi
Copy link

In markdown, we use <!--more--> as a marker of "end of summary" for hugo.

Reference

Can the below be supported for org?

** more ..
Here is how you can insert a =<!--more-->= to mark the end of summary for hugo parsing.
#+BEGIN_SRC text
This is on line 1
#+HTML:<!--more-->
This is on line 2
#+END_SRC

This is on line 1
#+HTML:<!--more-->
This is on line 2

Support #+HTML

This feature request is more than just support <!--more--> 😄

It is about supporting the org #+HTML: syntax.

Ref - Quoting HTML tags in org

Note that it can be #+HTML: or #+html:; it's case-insensitive.

Support @@html:...@@

Below MWE shows how the @@html:...@@ syntax (also mentioned in the above reference) can be used to force line breaks without starting a new <p> block.

Use this at the end of lines: =@@html:<br>@@=
#+BEGIN_SRC text
This is on line 1 @@html:<br>@@
This is on line 2
#+END_SRC

This is on line 1 @@html:<br>@@
This is on line 2

Note that a user can have this in their org file:

#+BEGIN_SRC text
This is on line 1 @@html:<br>@@@@latex:\\@@
This is on line 2
#+END_SRC

or

#+BEGIN_SRC text
This is on line 1 @@latex:\\@@@@html:<br>@@
This is on line 2
#+END_SRC

But the HTML parser only extracts the <br> portion from @@html:<br>@@.

@curiouslychase
Copy link
Owner

I think there are two issues here, so I'd like to consider it like this:

support Hugo user-defined split

I'd like to do this with a standard org comment, rather than us having this weird html comment as a work around (I've updated my Hugo PR with this)

support HTML syntax

This can be done in goorgeous, so there should be a PR for it this week hopefully.

How does that sound?

@kaushalmodi
Copy link
Author

kaushalmodi commented Feb 21, 2017

weird html comment as a work around (I've updated my Hugo PR with this)

The reason why org spec has special comments like #+HTML:, #+LATEX:, etc. is because the same org doc can be exported to html, tex, etc.

So the org parser needs to understand what stuff is limited to what kind of export.

That said, the solution to use # more specific to summary split is fine. But I hope that #+HTML: <!--more--> is also supported in future, staying faithful to the generic style of embedding HTML in org.


support HTML syntax

This can be done in goorgeous, so there should be a PR for it this week hopefully.

Do you mean: support @@html:...@@? :)

@curiouslychase
Copy link
Owner

@kaushalmodi in short: I'm going to support the #+HTML: and #+LATEX: functionality, but you don't need to use it for summaries in Hugo. :)

The way Hugo handles <!--more--> wouldn't work with anything other than a straight comment because of the way Markdown works and since it's stripped and not used, I thought it'd make more sense to use a convention that's native to org, rather than having a weird work around to make it work.

@curiouslychase curiouslychase changed the title Supporting hugo's user-defined summary split Support org spec for #+HTML Feb 24, 2017
@balaramadurai
Copy link

Thanks @chaseadamsio and @kaushalmodi for your help with including org mode in Hugo. Love it.

One question - may be a dumb one. I have hugo-universal-theme and I can't get the table to have borders and rules. I tried #+HTML: :border 2 :rules all :frame border :class striped table-striped but the html code hasn't changed for the table. Is this because #+HTML: is not yet supported?

@kaushalmodi
Copy link
Author

@balaramadurai Well, I am just a tester. I am pestering @chaseadamsio with feature requests.

This issue is still open. So the #+HTML: support needs to be added.

But support for stuff like #+HTML: :border 2 :rules all :frame border :class striped table-striped is much more complicated. I believe it deserves a separate issue. You can put a minimum working example of the org file with that #+HTML: ... line, and an example of what the generated HTML should look like.

@curiouslychase
Copy link
Owner

@balaramadurai I'm with @kaushalmodi on this. I'm working on a Pull Request now to refactor the lexer/parser now so we can make these kind of changes easier to make without having to dig through the current parser. Can you open a separate issue with the desired input and output & I'll triage it?

@curiouslychase curiouslychase self-assigned this Apr 12, 2017
@podiki
Copy link

podiki commented May 2, 2017

Any updates on this issue? It would really add a lot of flexibility to use any necessary html in org, as one can from markdown, with hugo.

@curiouslychase
Copy link
Owner

I had a branch I was getting ready to PR into Hugo this week that fixed this, but it looks like @niklasfasching PR'ed a new org parser, so I'm closing all the issues here, deprecating and archiving goorgeous.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants