Multi-line code blocks


#31

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


#32

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


#33

Piotr

Is it possible to use multiple CSS styles?

e.g.

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)


#34

nope https://github.com/isagalaev/highlight.js/issues/1073


Python code snippet comments become tags
#35

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.


#36

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


#37

That greasyfork link is now broken, but I gather it has become part of this larger effort, right? https://greasyfork.org/en/scripts/31392-dynalist-powerpack-2


#38

Yeah, unfortunately it can only be done in the notes/comment field right now, so we recommend doing that.


#39

Am I correct in assuming that the greasefork scripts only work in the web version and not on the iphone, etc?


#40

Yes, that’s correct.


#41

Are you going to merge Piotor’s script in the master branch or come with another solution?


#42

There’s lineNumber options on PowerPack2 that piotr incorporated in


#43

No, it will be difficult to incorporate Powerpack’s code.

If we were going to do it, we’re do it ourselves (not necessarily a dramatically different way, just a way that’s consistent with our current code).


#44

I use Powerpack2 code highlighting - great tool BTW, but I’d also like to modify CSS for inline codes that don’t have any language specified (think poor man’s highlight)

I added the following to Stylish :

.node-inline-code {
    color: #f0f0f0;
    background-color: #c7254e;}

However this messed with with PowerPack’s code highlight, anyone know a trick to make this work; such that my css will only work on codes where no language is specified?

print [i for i in range(10)]’ -> use Stylish CSS
python print [i for i in range(10)]’ -> use PowerPack

Thanks.


#45

Hi, try this .node-inline-code:not(.hljs) { ... }


#46

Thank you @Piotr


#47

This weekend I was working with code snippets and was trying to put them into dynalist. Other than a note field, which didn’t really suit my purpose, I had the same need as you describe here.


#48

Actually, a note field is good for me but I would like to have ‘code field’ with code highlights and which can be handled separately (like search in code fields etc.). Maybe this is the way?


#49

Just adding my +1 again for using code blocks, whether it’s in the note field or has syntax highlighting or not. I understand that it would be difficult to implement without fundamentally changing Dynalist in some way. I have been using Notion for taking notes, but am too used to the autoformatting of all the things into a flexible outline.


#50

I’ve found that you can do code without syntax highlighting using the following procedure:

  1. Make a new bullet
  2. Immediately press shift-Enter
  3. Type three backticks and your first line of code
  4. Hit Enter
  5. Type your other code, continuing to use Enter
  6. When you’re done, type three more backticks

You end up with a code block hanging off a bullet with an empty line; not the greatest looking but still okay: