tumblr / docs

Tumblr's public platform documentation.
Apache License 2.0
108 stars 26 forks source link

NPF code blocks? #38

Closed leo60228 closed 3 years ago

leo60228 commented 3 years ago

Based on the docs discouraging usage of the legacy post format, I assumed that NPF was intended to have a superset of the functionality. However, NPF doesn't seem to support monospace/code or syntax highlighting, features that were used even by the NPF announcement! I can emulate code blocks and syntax highlighting myself using the chat subtype, but that doesn't help for inline code at all.

cyle commented 3 years ago

Yes, currently NPF is not a superset of the legacy post format. There are many overlaps, but there are pieces on either side not supported by the other, as you point out. At this time we're not planning to support inline code blocks or syntax highlighting in NPF, and using the "chat" subtype for monospace font usage is the current intended workaround.

If you'd like to see support for inline code-style formatting or syntax highlighting, feel free to submit feedback via the Tumblr Support form. Feedback like this helps us determine what to work on next!

leo60228 commented 3 years ago

@cyle Good to know. It's worth noting that I ran into this while trying to do something different. I'm trying to write a Tumblr client using Markdown for posts, and while Markdown can be used directly through the legacy format, the API docs seemed like it was encouraged to use NPF in new applications. Because of this, I started working on a Markdown to NPF converter (which ended up being surprisingly simple), but I got confused by how it seemed like some Markdown features weren't possible to implement.

Is it just the case that this is a limitation of NPF for the time being, or is it expected that applications wanting to use Markdown should keep using the legacy post format instead of NPF?

cyle commented 3 years ago

Is it just the case that this is a limitation of NPF for the time being, or is it expected that applications wanting to use Markdown should keep using the legacy post format instead of NPF?

Honestly I don't know right now whether or not support will come to NPF for those formatting options, so if you want to preserve them today, I'd encourage using the legacy post format (however, understand that those posts will not look the same on the dashboard and in the mobile apps versus on blog pages, since all posts are in NPF when viewed within Tumblr's official clients).

You can still save new posts in Markdown format via the legacy posting route if you want, and when NPF supports outputting those formatting styles during rendering in our clients, it'll "just work" from our end.

leo60228 commented 3 years ago

Oh, to be clear, I don't really need code blocks. I'd just like to be able to author content in Markdown and post it through the API, and the lack of code blocks made me question whether I should be using NPF at all. This is just for personal use, I don't anticipate any issues as a direct result of not having code blocks.