Giter Club home page Giter Club logo

Comments (12)

linux-man avatar linux-man commented on July 23, 2024 1

b6262ae
I'm closing this issue. Fell free to reopen it.

from unreel.

linux-man avatar linux-man commented on July 23, 2024

Near the end of the demo you have a slide with code syntax highlight. Is that what you need?
On edit mode:
Formats > Blocks > Pre followed by Formats > Inline > Code

from unreel.

KSXGitHub avatar KSXGitHub commented on July 23, 2024

Yeah, but I don't see any option to change language (for highlighting)

image

from unreel.

linux-man avatar linux-man commented on July 23, 2024

That should be automatic. It uses highlight.js, where you can read:

174 languages and 77 styles
automatic language detection
multi-language code highlighting

and a lot of other good stuff.
You really have to finish editing to see how it looks.

from unreel.

KSXGitHub avatar KSXGitHub commented on July 23, 2024

I don't know how many lines I have to write to get highlighting works but sometime I just want to write a short code. Furthermore, I don't think auto language detection is good enough, user should be able to choose language.

image

from unreel.

linux-man avatar linux-man commented on July 23, 2024

imagem
You aren't doing it right!
Code must be inside <pre><code> tags. With
imagem
you get
imagem
Automatic detection may fail. You can choose a language by adding a class to code tag, like this

<pre><code class="javascript">
var car = {type:"Fiat", model:"500", color:"white"};
document.getElementById("demo").innerHTML = car.type;
</code></pre>

The language list is here.
Before you ask, there's no way to change highlight style.

from unreel.

KSXGitHub avatar KSXGitHub commented on July 23, 2024

Is there any way to insert code without opening 'Source Code' dialog? Unreel is not a text editor (like Vim, Sublime, Atom, etc.), it should not ask user to do so.

from unreel.

linux-man avatar linux-man commented on July 23, 2024

Yes. Do
imagem
imagem
and write or paste the code.
You can go to Source Code to choose the language.
Source Code should be used for special formating, and sometimes to clean the HTML mess you can do without knowing (HTML can be really messy 😃).

from unreel.

KSXGitHub avatar KSXGitHub commented on July 23, 2024

Thanks.
Still, this is tricky. I guess very few people know this.
Can you just add one menu option (Formats > Blocks > Code)?

from unreel.

linux-man avatar linux-man commented on July 23, 2024

I could, but I'm a purist: 1 option -> 1 format.
<pre> and <code> can stand on their own and be useful to someone...
imagem

from unreel.

KSXGitHub avatar KSXGitHub commented on July 23, 2024

If "pure" means 1 option for 1 html tag, this makes sense
But if 1 option was meant to be 1 visual element, Format > Inline/Block > Code is make symetry

from unreel.

linux-man avatar linux-man commented on July 23, 2024
  • We don't have to agree, just to understand each other.
  • I get your idea, but for now I'm not gonna change formats menu. The one place I wouldn't mind to add a "Syntax Highlight Code Block" would be at "Templates", where you can find other "complex" structures.
  • Those 1% that will use syntax highlight like you and me can understand these concepts better than the other 99% that don't need to show their code. After all, syntax highlight is a great "bonus", but seldom used.
  • Most important: YOU know how to do it.
  • Thank you for using Unreel.

from unreel.

Related Issues (8)

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.