Code Monkey home page Code Monkey logo

Comments (4)

jgm avatar jgm commented on September 25, 2024 1

All in all I think

is rather a layout than a content tag (just like in this HTML minifier).

I think we're using <section> correctly, judging from the documentation here.

You can use a filter to remove the section entirely:

return {
  section: (el) => {
    return el.children;
  }
}

Save as nosection.js and run with djot --filter nosection.js.

This will also remove the automatic identifiers, though. Alternatively, you could add a special class:

return {
  section: (el) => {
    el.attributes.class = "djot";
  }
}

If you're using djot as a library, you could also use the HTML renderer override documented on the readme, to render the section as something else...

from djot.

matklad avatar matklad commented on September 25, 2024

I think we're using

correctly, judging from the documentation here.

One difference is that the example here doesn't have the topmost section wrapping h1, which also the behavior I want (for my blog, I put djot's result into an <article>). But this really is just ambiguity between using # for sub-section titles and for the document title.

from djot.

Brixy avatar Brixy commented on September 25, 2024

Thank you, John, for your answer and technical insights. Very interesting and helpful.

I think we're using <section> correctly, judging from the documentation here.

Yes, of course: The generated HTML code is not only valid but also semantic.

Actually I forgot to mention one point: I was not talking about djot-to-HTML standalone files but about (rather complex) webprojects generated with an SSG using Djot as the markup language for the content. In these cases wrappers around the actual content may cause problems and break the design, depending on the project.

Of course, it is always possible to adress these problems with CSS (but it gets trickier), and it’s good to know how to turn Djot’s wrapping functionalities of if needed.

Thanks again—and thank you so much for Djot!

from djot.

Brixy avatar Brixy commented on September 25, 2024

One difference is that the example here doesn't have the topmost section wrapping h1 …

Good point. (It has always been a problem that HTML lacks some kind of title tag for the body. Using h1 was not the best idea and caused a lot confusion.)

from djot.

Related Issues (20)

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.