Multi-line code blocks


It has nothing to do with TM, or at least with this script, it’s limited to work on and for specific classes within this url.

Easiest (for me) in similar situation would be to open chrome dev tools and see how those colors are applied, there will be some hints.


oh okay I got it now

press ctrl+alt+h to disable the preview

looks really nice

Also what other style themes do you generally like? I was really used to Monokai sublime but I really like the railscast you have

Just wanted some suggestions on a default dynalist white theme

also could you enable code preview by default? Whenever I go on dynalist its not highlighted yet and I have to press CTRL+ALT+H.

Also when I click away I have to press CTRL+ALT+H. Isn’t there a javascript event handler to tell the script to rerun again (e.g. you move cursor on a note, then move away from it). I’m not sure how that would be implemented though, i think we had a similar discussion on the “focus” mode CSS post last time.

Also @Erica should use this framework when implementing code support :slight_smile:

thanks @Piotr


Happy to see it works for you :slight_smile:

It should HL your code when tab is reloaded, isn’t it working? I can make it works each time when you load documents from left pane, just like focus mode is updated each time, but with my current implementation when you have multiple scripts enabled then it will become laggy. I’m doing other things with scripting DL right now and I’m making some progress in understanding it in general, so I think in near future I will improve it to highlight code automatically each time.

My favourite theme is Twilight, but it’s not available in HL.js. Other than that, I can work with basically any theme with dark grey background, Monokai Sublime is pretty, Darcula too :slight_smile: I’m using DL with dark theme, so I choose in HL.js also dark theme, but feel free to experiment what looks best in default for you :slight_smile:


piotr I can’t find what the standards are for each programming language

What are they? Also, I noticed it needs to be all lowercase / case sensitive. E.G. “php” not “PHP” . I tried running the following languages

`c → not working
`c++ → not working
`c# → not working
`objective-c → not working
`html → use “xml” instead
`excel VBA → highlight.js has no support for this
`autohotkey → highlight .js has no support for this either
`shell (git push commands, command line)
`diff (difference file checker results)

They all worked, however C, C++, objective-C and C# didn’t work for me.

Sample run data here: some of my notes were at bottom on accident


c -> I think that HLjs use the C++ syntax file for that, I don’t see separate file for C
c++ -> cpp
c# -> cs
obj-c -> objectivec

I see support for autohotkey:
doesn’t this work for you?


it works perfectly now piotr thanks

those were the correct things for the C language

Also, I got excel VBA to sort of work, but its missing a lot of highlighting support for various words like DIM or SUB compared to github gists CSS support

If I rely on it a lot I might just fork and push support for excel VBA down the road maybe on their github pages


Phrase Express Macro to navigate around very large opened-lists
Gathering API v0.1 ideas


I ended up getting excel VBA integration using Visual Basic


// @require

Also, I don’t know why but the word “Excel” keeps getting highlighted some reason on my normal doc

EDIT it was another chrome highlighter extension I had on that ran off the same hotkey as CTRL+ALT+H



I printed out some of the code to see what it’d look like on paper

Here’s a sample PDF which made using Chrome+ Printing webpage + CutePDF printer

then rescanned into a .png to upload here. I used an embedded inline image ![]() there too in doc

(zoom in on image to see more)

Looks really clean

Although my print pdf doesn’t recognize the `codeblocks`

which is another issue all together related to dynalist, but just wanted to show some use-case examples of the code syntax highlighter you made :slight_smile:



is there a way to get line numbers as a potential option here?

I find that I am constantly breaking down code and referencing it by line numbers on visualstudiocode, but I don’t have any line numbers to reference on dynalist

Line numbers reference:

How i am using notes to break down code: (python generators was a really complicated topic for me,so I had to debug / take notes on a lot of step by step / identify patterns)

expand images its fairly big


Also I thought of more things related to the sort function from powerpack here

I could also use this to count how many times a program execute something on a specific line, if I wrote all my line numbers consistently (Sort by NUMBER).

Then re-sort later by “created” date since there already organized from get-go

There’s probably something in visual studio code for outputting debugging log data into a .txt file which I could later process into python → import into dynalist OPML format

this would make breaking down software much easier imo using dynalist

You could import “step into” or just “step over” debug logs and consequently be able to take notes on it in dynalist


Not by default
I tried with but I can’t post it to
Code uses an unapproved external script: @require

you need to copy that code manually to your installed script
remember to copy your languages in @require before that


ah it looks pretty now :slight_smile:

by the way

is there a way to toggle on / off the line numbers with a shortcut key?

like ctrl+shift+alt+H to turn off line numbers?


yes, but it will be with line numbers by default, you can toggle visibility later with ctrl+shift+alt+h


works nicely :slight_smile:

okay i ran a diffcheck on your code

could I also have the reverse order? (no line numbers ctrl+alt+h, toggle with line numbers)


swap $('td.hljs-ln-numbers').toggle();


td.hljs-ln-code seems unnecessarily long, and sticks around when untoggled.

how do i get the original looking unhighlighted format on toggle?

e.g. this issue

also toggling does some weird things, depending on what items were rendered / unrendered


if that’s not ok for you then revert to original version or version with l-n always activated


okay i just made a duplicate script so i can just pick one or the other



Is it possible to use multiple CSS styles?


Using 2 CSS stylesheets and picking which one you want to use

e.g. \javascript - code goes here`` activates one CSS theme (monokai sublime)

e.g. \javascript1 - code goes here`` activates another CSS theme (railscast)



Python code snippet comments become tags

Is it possible to copy+paste blocks of code to dynalist, say from Stackoverflow or from an IDE?

When I try pasting it splits the code to separate items for each new line.
One place I can paste to is the comment field.


Not yet. See Pasting multi-line text as single item


That greasyfork link is now broken, but I gather it has become part of this larger effort, right?