msprev / panzer

pandoc + styles
BSD 3-Clause "New" or "Revised" License
159 stars 15 forks source link

read allowed in commandline metadata #16

Closed halloleo closed 6 years ago

halloleo commented 9 years ago

Hi again, I have created a first version where the read option can be set in the style files. It works with an style entry like:

md-base:
    all:
        commandline:
            read: "`markdown+autolink_bare_uris+multiline_tables+table_captions+definition_lists`"

It doesn't have protection against use in none-markdown source files yet, but it's a start.

msprev commented 9 years ago

Thanks for this. I need to think more carefully about it, and the best way for users to activate this option. Let me think on this.

msprev commented 9 years ago

How about something like:

Base:
    all:
        metadata:
            numbersections: true
        commandline:
            smart: true
            standalone: true
        filter:
            - run: smallcaps.py
        markdown:
            - on: multiline_tables
            - off: table_captions
halloleo commented 9 years ago

Firstly, thanks for taking this on. One of my objectives is not to end up with a fork.

Secondly to your suggestion: I can see my simple proposal to make the read option settable has severe disadvantages. So introducing new yaml fields might be the way to go.

halloleo commented 9 years ago

To the naming of the new yaml field: are extensions in pandoc exclusive to markdown? Couldn't we have a general extensions field, which would be added to all applicable --read=<format> options, not only to --read=markdown? Just a thought...

halloleo commented 9 years ago

More thoughts: It might be harder to implement, but using true/false would be mor concicten with other fields than using on/off. I.e.:

Base:
    all:
        metadata:
            numbersections: true
        commandline:
            smart: true
            standalone: true
        filter:
            - run: smallcaps.py
        markdown:
            multiline_tables: true
            table_captions: false
msprev commented 9 years ago

Ok, I think that this syntax is the best option.

No extensions exist for other formats, so it's only relevant to the markdown reader.

msprev commented 9 years ago

Or how about:

Base:
    all:
        metadata:
            numbersections: true
        commandline:
            smart: true
            standalone: true
        filter:
            - run: smallcaps.py
        extension:
            markdown:
                multiline_tables: true
                table_captions: false
msprev commented 9 years ago

Ok, currently going with this syntax:

Notes:
    all:
        read:
            markdown:
                multiline_tables: true
                table_captions: false
            latex:
                auto_identifiers: true
halloleo commented 9 years ago

I think the hierarchical subdivision in extensions and markdown is good! - I'm not so sure about the naming read: After all read is the keyword for the pandoc option. - I think another name like extension avoids confusing

msprev commented 9 years ago

I'll think on about it. I'm not keen on extension as it does not say whether the extension applies to the reader or writer. That can look confusing in a style definition. This field only applies to the reader.

msprev commented 9 years ago

Just to say that I'm going to implement this feature, but it is non-trivial and I want to get it right. It won't appear for a while yet.