Giter Site home page Giter Site logo

Comments (7)

tajmone avatar tajmone commented on July 17, 2024 1

I just wanted to inform you and the others, that there is now a lua-filter which implements the gfm task lists.

I saw the notification about its release, but didn't have a chance to try out yet, but it's definitely great news!

Propably this is a better approach than to do it with pp.

Definitely better. And it should be possible to use it along with other PP macros too, so existing documents that use the PP macros for task lists will still work, while they are ported to the new Lua filter method. As for the CSS, that remains the same (and the PP macro !TaskListInlineCSS still comes handy when working with documents or templates that don't provide CSS styling for Task Lists!)

Maybe you could make a note about that in the readme here, that it may be better to use this lua-filter instead of your code?

I will, and thanks for reminding me about it — I've been absorbed on some other pending projects and didn't find time to update Pandoc-Goodies lately.

I don't want to make your contributions bad, though, and I want to thank you again for your efforts.

On the contrary, you're improving the project with your advise (and shielding me from my chronic forgetfulness).

from pandoc-goodies.

tajmone avatar tajmone commented on July 17, 2024 1

I'll just use the lua-filter and then ... all is ok, I guess.

maybe, but I haven't had the chance to try this. GitHub task lists are rendered via classes, not plain HTML tags. So, styling is needed to achieve the actual look and feel of Task List boxes, otherwise they look broken.

Why are you doing so much work?

In this repo I'm just sharing with others some code that I use in other personal projects I maintain (some public, most private). These projects rely heavily on some of the code published here (plus others not found here), and they consists of literally hundreds of document files. Macros and styling are an important part of that work, and even though most projects use different styles, I try my best to keep all that it's possible into commonly shared modules, which makes it easier to maintain.

The passage to pandoc v2 broke many documents, but having a comon code base allowed me to quickly fix issues and port all documents to work with v2 in a half day work.

Strange as it might sound, editing and creating script-automated documentation is one of the main areas of my job, so I often need to find workarounds to fit my needs to large scale projects. Maybe the Pandoc-Goodies project doesn't make much sense as it is right now, as I surely haven't managed to give it a specific goal or spend more than so much time docuemnting it. What I'm trying to do right now is sharing into the open source part of the code solutions that I've built for my everyday job, in the hope that others might benefit from it (I assume that people working in the same areas tend to bump into the same problems).

I am not in a position to share all of the code I employ in my work, for obvious reasons; but whenever it's possible to do so, I'm happy to do it.

Most of the stuff published here works out of the box, regardless of the choatic context. At the end of the day, a working template is a usable template. Other stuff might make less sense at a first glance 😢 — but it hopefully will, as I find the time to put the various bits and pieces together 😄 (as they are in the toolchain I work with).

from pandoc-goodies.

virgilwashere avatar virgilwashere commented on July 17, 2024 1

And even better,

pandoc/lua-filters@8e33efb

Remove filter task-list

Task lists are now supported by pandoc, thereby rendering the
task-list filter obsolete.

from pandoc-goodies.

tajmone avatar tajmone commented on July 17, 2024

For the time being I've added a note in the PP macros "GFM Task-List" section, mentioning the task-list Lua filter as a better alternative, and providing links to it:

When I have more time, I'll carry out some tests with the filter, to see if the current "GitHub" HTML template styles for Task Lists work out-of-the-box with the html ouput of the filter, or if I need to tweak the SCSS source to cover styling of Task Lists created with either PP macros or the Lua filter.

Ideally, the GitHub HTML template show display Task Lists with the exact same styling, regardless of how they were generated. Probably some tweaking or extra class names will be needed to achieve this, even through from a quick peek at the Lua source it seems it adopts the same classes naming convention as GitHub.

I'd rather change the PP macros and the Template's Sass files to adapt them to the Lua filter output, in order to attain same styling in HTML and the current template, than create a tweaked version of the Lua filter.

In this respect, if you've had a chance to test it, and you have some suggestions regarding the compatibility status of the filter HTML output with the GitHub HTML5 template stylesheet, and/or if using the filter along with PP TaskList macros causes conflicts or differing styled checkboxes, please tell me about them.

from pandoc-goodies.

robinrosenstock avatar robinrosenstock commented on July 17, 2024

Ideally, the GitHub HTML template show display Task Lists with the exact same styling, regardless of how they were generated. Probably some tweaking or extra class names will be needed to achieve this, even through from a quick peek at the Lua source it seems it adopts the same classes naming convention as GitHub.

I'd rather change the PP macros and the Template's Sass files to adapt them to the Lua filter output, in order to attain same styling in HTML and the current template, than create a tweaked version of the Lua filter.

It is not really clear to me what you mean with all of this. Why is this needed, especially with the templates and css you mentioned? Personally I'll just use the lua-filter and then ... all is ok, I guess.
Why are you doing so much work?

from pandoc-goodies.

tajmone avatar tajmone commented on July 17, 2024

Thanks for the update @virgilwashere !

from pandoc-goodies.

tajmone avatar tajmone commented on July 17, 2024

@geniusupgrader , you were right: current pandoc version doesn't need any CSS to show correctly the checkboxes of task-lists. Even when outputing to a non-standalone document, which contains no CSS, they show properly. The HTML generated is:

<ul>
<li><input type="checkbox" disabled="" />
Element 1/li>
<li><input type="checkbox" disabled="" checked="" />
Element 2</li>
</ul>

Anyhow, I'm now gradually updating the whole repo to latest pandoc and PP version. After over a year without updates some minor tweaks are required. Nothing huge, but a couple of macros stopped working as expected, CSS styles needed tweaking, and some macros are just obsolete.

Also, there are new features which could be exploited in both pandoc and PP.

from pandoc-goodies.

Related Issues (10)

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.