leo for simple web development

90 views
Skip to first unread message

gar

unread,
Nov 7, 2019, 2:28:51 AM11/7/19
to leo-editor
Hi, dear leo people!

Now I am trying to use Leo for creating very simple html/css/js.
I am using plain-files oldschool approach with a couple of hand-made commands over it.

But suddenly I asked myself: may Leo already have anything like @rst mode for html/css/js?
There each file may be an `@html /path/to/file.html` outline node, every it's child may be a tag if it starts say with `<tag` or something.
There could be command like rst3 to build it all into a final file.

I searched thru the code and docs and found no traces of that.
If I miss something - please let me know, it would greatly simplify my current jobs since dealing with plain files is pretty boring in leo.
Or may be there are some good practices on how to write html code in a leonine way.

Any help appreciated, thanks!

Edward K. Ream

unread,
Nov 7, 2019, 10:55:13 AM11/7/19
to leo-editor
On Thu, Nov 7, 2019 at 1:28 AM gar <gar...@gmail.com> wrote:
Hi, dear leo people!

Now I am trying to use Leo for creating very simple html/css/js.
I am using plain-files old school approach with a couple of hand-made commands over it.

But suddenly I asked myself: may Leo already have anything like @rst mode for html/css/js?

For simple pages, @file or @clean trees will work.

For example, in LeoDocs.leo, see @file html/index.html.

Also, Leo has importers for .html, .js and .php files.

HTH.

Edward

Rob

unread,
Nov 7, 2019, 4:07:46 PM11/7/19
to leo-editor
Writing html/css/js in Leo is super easy. I use 2 different approaches, depending on what I need the output to be.
  1. The most straightforward approach is to write the page in regular @file or @clean node outlines. Consider creating abbreviations for the most common tags to greatly speed up the writing process and minimize errors (eg. `h1` expands to <h1>Headline 1</h1>).
  2. For some applications, I need multi-output (html and LaTex, for example). In that case, I write in @rst trees, then use pandoc to create the output files.
Rob...

gar

unread,
Nov 7, 2019, 10:46:21 PM11/7/19
to leo-e...@googlegroups.com
Thank you, gentlemen.

I would also love to have a better coloring scheme for HTML/JS (the https://leoeditor.com/coloring.html?highlight=colorizer can help me with it I beleive) and especially coloring of matching tags feature.
Can you please advise me where to start from if I try to implement 'matching tags'?

пт, 8 нояб. 2019 г. в 00:07, Rob <lar...@gmail.com>:
--
You received this message because you are subscribed to the Google Groups "leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to leo-editor+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/leo-editor/fc637b55-4828-4a56-9243-1d1cb0159f3e%40googlegroups.com.

Rob

unread,
Nov 8, 2019, 6:47:37 AM11/8/19
to leo-editor
Not exactly sure I know what you're asking. This is what it looks like for me simply by using the @language html directive. I use abbreviations to help with matching tags, though perhaps there's another way I'm not aware of.

191108 Leo HTML.PNG

gar

unread,
Nov 8, 2019, 7:52:47 AM11/8/19
to leo-e...@googlegroups.com
Rob, I'd love to see matching <h1> and </h1> in bold when cursor is inside any of this tags.
I do really miss "emphasize matching bracket/keyword" feature in leo.

пт, 8 нояб. 2019 г. в 14:47, Rob <lar...@gmail.com>:
--
You received this message because you are subscribed to the Google Groups "leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to leo-editor+...@googlegroups.com.

Edward K. Ream

unread,
Nov 8, 2019, 8:04:50 AM11/8/19
to leo-editor
On Fri, Nov 8, 2019 at 6:52 AM gar <gar...@gmail.com> wrote:
Rob, I'd love to see matching <h1> and </h1> in bold when cursor is inside any of this tags.
I do really miss "emphasize matching bracket/keyword" feature in leo.

Leo matches parentheses when typing, so this must be possible.
I have just created #1433 for this.

Edward

Rob

unread,
Nov 8, 2019, 8:06:19 AM11/8/19
to leo-editor
Sorry I can't help there. Perhaps there could be something related to the flashing brackets code. However, that never works for me anyway, not sure why.

gar

unread,
Nov 8, 2019, 8:24:03 AM11/8/19
to leo-e...@googlegroups.com
Edward, the problem is a bit wider when I described it. If to consider it as a problem at all.

All modern IDEs or programmers notepads have several very useful visual effects:
- highlight matching parent/brace/keyword when cursor moves thru 
- highlight all words equal to the word under the cursor in the current document
- ctrl-f3 / ctrl-shift-f3 for fast find word under the cursor forward/backward in the current document (yeah, I know about F3 and ctrl-shift-F in leo but still - ctrl-f3 is very useful)

Actually these features are the ones I miss most in leo - their absence slows down my editing more then absence of vim mode :-)

пт, 8 нояб. 2019 г. в 16:04, Edward K. Ream <edre...@gmail.com>:
--
You received this message because you are subscribed to the Google Groups "leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to leo-editor+...@googlegroups.com.

gar

unread,
Nov 8, 2019, 10:18:26 AM11/8/19
to leo-e...@googlegroups.com
And also I noted that keywords from JS's ES6 like 'let' are not supported.

пт, 8 нояб. 2019 г. в 16:23, gar <gar...@gmail.com>:

Edward K. Ream

unread,
Nov 8, 2019, 10:51:23 AM11/8/19
to leo-editor
On Fri, Nov 8, 2019 at 7:06 AM Rob <lar...@gmail.com> wrote:
Sorry I can't help there. Perhaps there could be something related to the flashing brackets code. However, that never works for me anyway, not sure why.

It works for me.  I'm the one to do this enhancement.

Edward
Reply all
Reply to author
Forward
0 new messages