Coder Social home page Coder Social logo

ox-slimhtml's People

Contributors

balddotcat avatar purcell 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

Watchers

 avatar  avatar  avatar  avatar  avatar

ox-slimhtml's Issues

Support embedded images

Spinning this out to its own issue from #7.

ox-html checks if a link is the only content for a paragraph, and if so checks if the link's file extension matches in a customizable list, to determine whether or not to emit an <img> tag into the exported HTML. If the paragraph has a #+CAPTION keyword it will use the caption value as well. ox-slimhtml should be able to emit images as well, although with simpler HTML than ox-html emits. There is also support for #+ATTR_HTML to explicitly set attributes on the <img> tag.

As an example, org-mode versus ox-html output, as well as what ox-slimhtml currently emits:

#+CAPTION: This is the image caption.
#+ATTR_HTML: :width 300
[[http://example.com/picture.png]]

ox-html:

<figure id="orgfffffff">
<img src="http://example.com/picture.png" alt="picture.png" width="300">

<figcaption><span class="figure-number">Figure 1: </span>This is the image caption.</figcaption>
</figure>

ox-slimhtml:

<p><em>//example.com/picture.png</em>
</p>

Since <img> is an inline tag, despite being only supported as block-level content by Org, we should probably wrap the emitted image tag within a block such as a <div> or <p> tag, even if we don't support captions.

I've been hand-modifying ox-slimhtml's output so that the example above would become like this:

<p><img src="https://example.com/picture.png" alt="This is the image caption."/><br/>
<em>This is the image caption</em>
</p>

Open questions:

  • Support captions or not?
  • Support custom tag attributes or not?
  • Use org-html-inline-image-rules or hard-coded extension list? (By default, the rules only match for file, http, https schemes for GIF, JPEG, PNG, and SVG files.)
  • What should the alt attribute be set to? (ox-html defaults to the base filename unless explicitly overridden by #+ATTR_HTML)

Troubles auto-loading

I'm not sure if this is a problem with my config. Can you provide an example of loading ox-slimhtml into your Emacs?

For some reason, if (load ox-slimhtml) is a part of my config, it does not load the package properly. If I go and run this command manually, it works.

Links without contents should generate links with the raw URL as the hyperlink text

Currently, link objects with a non-nil link property but with nil contents are exported as the link (without schema/type) wrapped in <em> tags. Instead, slimhtml should do the same as the default HTML export backend, and generate a proper anchor tag with the raw link value as the anchor text.

Test case:

[[https://example.com/test.html]]

Current output:

<em>example.com/test.html</em>

Expected output:

<a href="https://example.com/test.html">https://example.com/test.html</a>

Support footnotes ?

Hi @balddotcat ,

I'm using your light html export for a project, so first thank you for this work !

As i see, i don't found footnote support (:with-footnotes), very common in academic website.
Same with option org-html-footnotes-section

I also try this :

(org-export-define-derived-backend 'ox-slimhtml-publish-to-html 'slimhtml
  :translate-alist '((bold . ox-slimhtml-bold)
                     (footnote-definition . org-html-footnote-definition)
                     (footnote-reference . org-html-footnote-reference)
                     (special-block . org-html-special-block)))

Could you please add some paragraph of documentation to explain how users could expand ox-slimhtml to reinject ox-html missing part, like footnotes ?

Thanks,

Use of ox-slimhtml's `org-export-string-as`?

Hi, I started depending on your nice library, and use org-export-string-as to convert an org entries' headings and contents from string to html here and here (the front is just org entry's heading, and the back is all possible org-mode elements until the next heading, i.e checklists, source and quote blocks, etc, but no hierarchy). Is this a sensible use of this function?

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.