Code block highlighting

Is there a way to get code block highlighting based on language?

I do not yet get the question. Could you give me more context on this.

Drafts has different options of displaying and organizing text.

If you think of drafts as a text-editor to edit a long form markdown/asciidoctor document with code blocks I would say: no not implemented

If you split up the document and have a code only draft: Depends on your language (JavaScript works fine others should follow n the upcoming weeks - due to the new custom syntax feature)

If you think about a preview (read only) from your drafts it should be workable with some of the given actions.

The new syntax feature should allow multiple coding languages in code blocks but I am not shure how this would affekt the speed of the background highlighter though.

Maybe @agiletortoise has something planned to create nested syntax parsers but I would assume that this is far out.

Side Note: I use working copy as a kind of code editor … ask me if you are interested in more details

1 Like

I think @BeardedWonder_30 means the “triple backtick with language name appended” syntax.

1 Like

In previews? Yes. Example action using Highlight.js

In the editor? No.

1 Like

Yeah thats exactly what I mean.

Would that be something that is added in the future? I like to keep code snippets in drafts.

working copy? I haven’t heard of that. what is it?

Working Copy is an amazing full-featured git client for iOS. It handles pretty much any git content management you could imagine, e.g. resolving merge conflicts and rebasing. Even better, it has strong integration with iOS including making your repositories available as folders in the Files app, strong Shortcuts support, open in place so you can use code editors like Textastic. To get back to the original question, It has a very good built-in editor with syntax marking.

As you can guess, I recommend it highly - this app once saved my bacon on a high-visibility release, and I use it regularly for writing.

Oh yeah, it integrates well with Drafts.

2 Likes

Oh cool. I will have to look into it for sure.

2 Likes