Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code blocks should be able to have default language set #97

Open
Ferada opened this issue Nov 11, 2015 · 4 comments
Open

Code blocks should be able to have default language set #97

Ferada opened this issue Nov 11, 2015 · 4 comments

Comments

@Ferada
Copy link
Member

Ferada commented Nov 11, 2015

3bmd apparently has the *code-blocks-default-colorize* setting to supply a default language to use for code blocks. It would be great if we can set this from the meta data of a post (or even the global blog settings?). The same would also apply to other settings - I'd even say that having some place to include custom code would be nice, e.g. in the blog settings and in the post meta data.

The other option I see would be modifying 3bmd with additional syntax to set variables, but that seems messier and less general.

@Ferada
Copy link
Member Author

Ferada commented Nov 17, 2015

I'm proposing Ferada@5b20c4d, or a variant of it. It's at the moment not how I'd ideally want to write it, specifically I'd rather use let: name value and also collect multiple lines into a list of bindings, rather than having to squeeze all of it into a single line.

Also, I haven't found a good justification for running completely arbitrary code, so I left that part out for now.

@libre-man
Copy link

libre-man commented Aug 26, 2016

Would it be an idea to change the metadata parser to implement white space sensitive newlines?
So that

tags: foo, bar, next
    fooz, baz

would be parsed the same way tags: foo, bar, next, fooz, baz would be parsed. I would propose that using four spaces to indent a line would be mean it is a continuation of the previous and that trailing comma's are not necessary, but should be possible.

@libre-man
Copy link

So I made a little proof of concept (libre-man/coleslaw@7cdd3e2) for parsing multiple-lines. The indentation is configurable and everything seems to work. If we would combine this with Ferada's commit we would be almost done with this feature if I'm not mistaking.

@Ferada
Copy link
Member Author

Ferada commented Aug 26, 2016

I'd rather have "one or more whitespace characters" as a condition for continuation lines, otherwise that seems sensible. If you really want that configurable maybe just specify that condition with a regex instead.

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

No branches or pull requests

3 participants