Giter Site home page Giter Site logo

Comments (4)

dkisselev avatar dkisselev commented on September 24, 2024

The PHP markdown library that daux is using allows you to "fence" code blocks, and to apply a class to those blocks.

http://michelf.ca/projects/php-markdown/extra/#fenced-code-blocks (near the bottom)

See if you can add a markdown class to a block and if highlight.js will grab it?

Also, fencing might not work in daux because it's using an older version of php markdown.

Edit:
Looks like the appropriate way to fence in the current version of markdown used by daux is with ` characters.

So to force-set a language, you could try this (i haven't had a chance to test it myself though):

```html

<?php <figure>Even though the auto-detect should see this as PHP, because we're overriding, the highlighting should only affect the HTML.</figure> ?>

```

from daux.io.

ashclarke avatar ashclarke commented on September 24, 2024

I shall try this out!

from daux.io.

ashclarke avatar ashclarke commented on September 24, 2024

That did the trick! Thanks.

(On a side note, it looks like the free version of MarkdownPad 2, which I am using to compile the docs, does not include fenced code, so you see the ``` in your preview window)

from daux.io.

dkisselev avatar dkisselev commented on September 24, 2024

Yeah, I think the ``` fence is compiler-specific.

You might be able to tweak the highlighting rules to add the ``` fences? I use Sublime Text and the plugins are open-source so you can add highlighting rules as needed.

from daux.io.

Related Issues (20)

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.