Skip to content

Output HTML #114

Closed as not planned
Closed as not planned

Description

@nicholaschiasson

Add support for outputting as HTML, both from CLI and from lib.

Activity

  1. dginev commented on Mar 22, 2023

    @dginev
    Contributor

    Adding on: If Typst's HTML output uses MathML for math syntax, that would be lovely (and feed into improved accessibility #133 )

  2. AntoniosBarotsis commented on Mar 22, 2023

    @AntoniosBarotsis

    Interestingly enough, there already seems to be some HTML involved in the testing.

    But yes, having the ability to generate proper, styled HTML would be great!

  3. jason-s commented on Mar 22, 2023

    @jason-s

    Adding on: If Typst's HTML output uses MathML for math syntax, that would be lovely (and feed into improved accessibility #133 )

    Alternatively, KaTeX-style support so the math could just stay as is in HTML, and be converted dynamically.

  4. claudiomattera commented on Mar 22, 2023

    @claudiomattera

    This is also necessary for supporting EPUB.

    Generating an EPUB from LaTeX is pretty much impossible.
    Hopefully a modern replacement for LaTeX will treat EPUBs as first-class citizen :D

    Actually, I would go one step further, and say that it should support plain text output (which is also almost impossible in LaTeX).

  5. Leedehai commented on Mar 22, 2023

    @Leedehai
    Contributor

    +1 for outputting HTML. This will make integration into popular note taking apps like

    • Obsidian, which uses MathJax for partial LaTeX capability in HTML
    • Notion, which uses KaTeX for even weaker LaTeX capability in HTML
    • VSCode, the beloved code editor

    much easier, and could increase Typst's popularity.

  6. bcourter commented on Mar 23, 2023

    @bcourter

    Great looking project! Am working on a combined book and website with math, and managing two environments is a huge waste of effort. Being able to have the same project for both, with shared libraries and glossary, would make it worth redoing from Latex/MathJax! Would want to replace Markdown in Jeckyll with it.

  7. sirinath commented on Mar 23, 2023

    @sirinath

    Maybe perhaps additional integration with GoHugo, GetZola, etc. can be added to be used instead of Markdown and AsciiDoc in static site generators. I posted this in initially in: #197

  8. AntoniosBarotsis commented on Mar 23, 2023

    @AntoniosBarotsis

    Not sure if you meant to link this issue @sirinath 😅

    But I agree, integrations with all those would be great even from a performance standpoint. No clue how that could work but would be willing to help if an effort is made towards it.

  9. sirinath commented on Mar 23, 2023

    @sirinath

    @AntoniosBarotsis Because #197 is a partial duplicate of #114 I added other parts not in this discussion.

    Sorry I initially pasted the wrong link.

  10. pranabekka commented on Mar 24, 2023

    @pranabekka

    The home page (typst.app) mentions HTML Export is coming soon, and they also mentioned it in their paper on Typst earlier this year.

  11. Leedehai commented on Mar 24, 2023

    @Leedehai
    Contributor

    Hi @pranabekka wondering if you could point me to their paper earlier this year? I'd be very interested to read but I was not able to find it online...?

  12. pranabekka commented on Mar 25, 2023

    @pranabekka

    Hi @Leedehai , you can find the pdf at https://www.user.tu-berlin.de/laurmaedje/programmable-markup-language-for-typesetting.pdf

    I think it's a little outdated, and you can find the same information in the online docs.

  13. phiresky commented on Mar 30, 2023

    @phiresky

    I created a draft PR which (indirectly) adds HTML output: #461

  14. added
    feature request
    html
    on Apr 5, 2023
  15. ttmc commented on Apr 6, 2023

    @ttmc

    Pandoc already has support for Typst markup, so everyone can use it to turn their Typst source files into HTML, EPUB, LaTeX, and a zillion other markups. You can even tell Pandoc how to handle equations in HTML, e.g. MathJax or KaTeX or MathML or whatever.

    https://pandoc.org/

    Please don't get distracted by supporting conversion to other markup languages. Trying to replace LaTeX (and the TeX ecosystem) is ambitous enough, never mind competing with Pandoc as well.

  16. Enivex commented on Apr 6, 2023

    @Enivex
    Collaborator

    Pandoc already has support for Typst markup, so everyone can use it to turn their Typst source files into HTML, EPUB, LaTeX, and a zillion other markups. You can even tell Pandoc how to handle equations in HTML, e.g. MathJax or KaTeX or MathML or whatever.

    https://pandoc.org/

    Please don't get distracted by supporting conversion to other markup languages. Trying to replace LaTeX (and the TeX ecosystem) is ambitous enough, never mind competing with Pandoc as well.

    Pandoc has a Typst writer, not a reader.

  17. claudiomattera commented on Apr 6, 2023

    @claudiomattera

    everyone can use it to turn their Typst source files into HTML, EPUB, LaTeX, and a zillion other markups

    Turning Typst *source* files to other formats is of very little use.

    You would get HTML-formatted Typst source (containing all the #show, #text and so on), but then you would still need to interpret that Typst source to generate its output.

    It is exactly the same thing with LaTeX.
    Pandoc copies verbatim the LaTeX source to HTML, without interpreting it.
    Or, better, Pandoc does implement a tiny subset of LaTeX, so that it can interpret trivial commands such as \emph{}, \subsection{}, or \cite{}, but everything else is unsupported (\citeauthor{}, \gls{}, \SI{}{}, \begin{tikzpicture}...).

    Trying to replace LaTeX (and the TeX ecosystem) is ambitous enough

    LaTeX does not support output formats other than PDF and DVI (if we exclude tex4ht, which does not really generate anything useable in my experience).
    Since one of its (and Typst's) use cases is writing books, I would consider supporting one of the modern book formats (EPUB, which is just zipped HTML) a very big YES toward Typst.

  18. rikhuijzer commented on May 4, 2023

    @rikhuijzer
  19. rikhuijzer commented on May 4, 2023

    @rikhuijzer
  20. laurmaedje commented on May 4, 2023

    @laurmaedje
    Member

    Relevant discussion: #721.

  21. claudiomattera commented on May 4, 2023

    @claudiomattera

    So, in summary: If you want HTML, PDF, ePub, and Kindle books, then you can already write in Markdown and use Bookdown or Pandoc to generate all those different output formats.

    I already explained my point above, but this just not the same thing.
    Not even close.

    Typst (and Latex) cover two separate aspects:

    • Actually generating PDF output from textual input.
    • Perform (arbitrarily complex) transformation on text.

    The former can easily be achieved, as you suggest, using Pandoc or Bookdown (which actually call Latex behind the scene).

    The latter cannot.
    Neither Pandoc or Bookdown can understand \citeauthor, \gls, \SI, \mypersonalcommand (nor the Typst equivalent).

    And this is extremely frustrating if you are writing a book in Latex, because it means you can only target PDF (or DIV), while in 2023 EPUB should be a first class citizen.
    Especially because most books are mostly text plus some maths, which is perfectly supported by HTML (and EPUB).

    Latex have the excuse of being ancient.
    If Typst does not embrace modern formats, it would be very disappointing.

  22. alerque commented on May 4, 2023

    @alerque
    Contributor

    @rikhuijzer Your statement "you can already ..." is simply not true yet because it misses the point. I have setup Markdown based workflows for several publishing houses and written typsetter software and Pandoc writers. I'm familiar with the moving parts here.

    Others have explained in some, but your statement would not be true until such a time as Pandoc has a reader as well as writer and can has extensions to allow raw typst code embedded in Markdown or other ways of handling the transitions. Additionally it needs a read/write conversion for the math dialect.

    Even with all that it still doesn't cover all the bases that HTML output from the compiler side (rather than just an input format reader) would handle, as others have explained.

  23. laurmaedje commented on Sep 18, 2023

    @laurmaedje
    Member

    Closing this in favor #721

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requesthtml

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions