Re: Not-clones that act like clones

2019-03-12 Thread Edward K. Ream
On Tue, Mar 12, 2019 at 2:55 PM Rob  wrote:

> Well, that certainly makes sense, thanks!

Glad to hear it.

> Now that I think of it that way, it reminds me that I do much the same
thing w/ LaTeX commands (macros) for repeatable blocks of text.

Excellent.

Edward

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Not-clones that act like clones

2019-03-12 Thread Rob
Well, that certainly makes sense, thanks!

>
> You typically don't need clones if your language can define a function.  
> Just call the function.
>
> Edward
>

Now that I think of it that way, it reminds me that I do much the same 
thing w/ LaTeX commands (macros) for repeatable blocks of text.

Rob... 

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Not-clones that act like clones

2019-03-11 Thread Edward K. Ream
On Sun, Mar 10, 2019 at 7:18 PM Rob  wrote:

> Thanks, Edward. However, I don't understand why it matters that html and
> css 'lack functions'.
>

You typically don't need clones if your language can define a function.
Just call the function.

Edward

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Not-clones that act like clones

2019-03-10 Thread Rob
Thanks, Edward. However, I don't understand why it matters that html and 
css 'lack functions'.

Imo, in your use case it's ok to use cross-file clones. The normal rules do 
> not apply because html and css lack functions.  
>
>
Thanks to everyone who 'weighed in' with comments; it appears that in my 
use case, that cross-file clones are the simplest, easiest way to 
accomplish my goal. Clones rock!

Rob...

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Not-clones that act like clones

2019-03-10 Thread Matt Wilkie
As I understand it, using cross-file clones is somewhat safer if the clones 
are *underneath* @file/@clean nodes and not the @file nodes themselves. (I 
got myself into a pickle before by cloning @file nodes under different 
@path parents; don't remember the specifics now).

Matt


-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Not-clones that act like clones

2019-03-10 Thread Edward K. Ream
On Sat, Mar 9, 2019 at 11:00 AM Rob  wrote:

> Suppose I have a xxx.leo file in which I write multiple web pages (or
> other document types, same question).
>
>- Each document is a separate @file (or @clean) external file.
>- Inside each web page are sections (nodes with or without children)
>that all need to be the same content (perhaps some css or js stuff).
>- I want all of the nodes to stay 'in sync' (change once, changes
>everywhere).
>- I could easily do that with cloned nodes. However, we are strongly
>encouraged *not* to create cross-file clones.
>
> Imo, in your use case it's ok to use cross-file clones. The normal rules
do not apply because html and css lack functions.  Try it and see what
happens. If Leo can do the job there is less reason to use templates.

The reason that I recommend against cross-file clones is that there is no
single "manager" or "owner" for the data.  But here the .leo file itself is
the manager of the clones.  Just be sure only to change date from a single
.leo file.  Then all should be well.

Edward

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Not-clones that act like clones

2019-03-09 Thread Rob
I have used html templates before in the context of CMS systems which 
already had the templating engines in place and would automatically replace 
the templates with the substitutions. However, that's not really what I 
need. I create html 'fragments' in Leo which are then copy/pasted into 
other online tools (such as an LMS or even a CMS) that typically have an 
html inline editor. I hate using the WYSIWYG editor, so I switch to source 
mode and paste the fragment copied from Leo. It works quite well, actually. 
In that scenario, these suggested  templating engines would require 
additional work to process to the output fragment. That's seriously 
overkill for what I'm doing.

>  
> There's also the Jinja2 templating system which is written in / uses 
> Python.  Bit of a learning curve but handy if you already know Python. 
> Used by the Django web app. stack.  They don't use Jinja2 directly, but 
> the templating system is almost the identical so if you ever think you 
> might want to work with Django there's some pay off there. 
>
> I wouldn't recommend the leo-cloud plugin, it wasn't designed with 
> multiple instances in one file in mind. 
>
> Cheers -Terry 
>
> > Vitalije 
> > 
> > On Saturday, March 9, 2019 at 7:18:39 PM UTC+1, Rob wrote: 
> > > 
> > > Thanks for clarifying, Vitalije. Yes, I'm the only one who would 
> > > edit them and I don't use external editors, so clones would 
> > > certainly be the easiest way to do that. I use \include{file.tex} 
> > > for LaTeX documents, but don't know about a similar mechanism for 
> > > html or css documents. Any of the other suggestions are way too 
> > > complicated; especially compared to clones. 
> > > 
> > >> As long as you are not using any other editor to edit those files 
> > >> and you are the only one who edits them, it is safe to use 
> > >> cross-file clones for this kind of problem. 
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Not-clones that act like clones

2019-03-09 Thread Terry Brown
On Sat, 9 Mar 2019 10:49:19 -0800 (PST)
vitalije  wrote:

> For HTML and CSS there are a lot of pre-processors for example: pug
> for HTML and sass for css. Both of them have more than one way to
> define some section once and use it anywhere you like it. Basically
> you write source files in pug and sass format, and then compile those
> source files into the final HTML and CSS files. It requires some
> knowledge of new languages like pug and sass, but allows you to write
> much less source code for producing the same HTML and CSS.

There's also the Jinja2 templating system which is written in / uses
Python.  Bit of a learning curve but handy if you already know Python.
Used by the Django web app. stack.  They don't use Jinja2 directly, but
the templating system is almost the identical so if you ever think you
might want to work with Django there's some pay off there.

I wouldn't recommend the leo-cloud plugin, it wasn't designed with
multiple instances in one file in mind.

Cheers -Terry

> Vitalije
> 
> On Saturday, March 9, 2019 at 7:18:39 PM UTC+1, Rob wrote:
> >
> > Thanks for clarifying, Vitalije. Yes, I'm the only one who would
> > edit them and I don't use external editors, so clones would
> > certainly be the easiest way to do that. I use \include{file.tex}
> > for LaTeX documents, but don't know about a similar mechanism for
> > html or css documents. Any of the other suggestions are way too
> > complicated; especially compared to clones.
> >
> >> As long as you are not using any other editor to edit those files
> >> and you are the only one who edits them, it is safe to use
> >> cross-file clones for this kind of problem.

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Not-clones that act like clones

2019-03-09 Thread Rob
Hmm, unfamiliar with those tools, will check them out. Thanks!

On Saturday, March 9, 2019 at 1:49:19 PM UTC-5, vitalije wrote:
>
> For HTML and CSS there are a lot of pre-processors for example: pug for 
> HTML and sass for css. Both of them have more than one way to define some 
> section once and use it anywhere you like it. Basically you write source 
> files in pug and sass format, and then compile those source files into the 
> final HTML and CSS files. It requires some knowledge of new languages like 
> pug and sass, but allows you to write much less source code for producing 
> the same HTML and CSS.
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Not-clones that act like clones

2019-03-09 Thread vitalije
For HTML and CSS there are a lot of pre-processors for example: pug for 
HTML and sass for css. Both of them have more than one way to define some 
section once and use it anywhere you like it. Basically you write source 
files in pug and sass format, and then compile those source files into the 
final HTML and CSS files. It requires some knowledge of new languages like 
pug and sass, but allows you to write much less source code for producing 
the same HTML and CSS.

Vitalije

On Saturday, March 9, 2019 at 7:18:39 PM UTC+1, Rob wrote:
>
> Thanks for clarifying, Vitalije. Yes, I'm the only one who would edit them 
> and I don't use external editors, so clones would certainly be the easiest 
> way to do that. I use \include{file.tex} for LaTeX documents, but don't 
> know about a similar mechanism for html or css documents. Any of the other 
> suggestions are way too complicated; especially compared to clones.
>
>
>> As long as you are not using any other editor to edit those files and you 
>> are the only one who edits them, it is safe to use cross-file clones for 
>> this kind of problem.
>>
>>
>>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Not-clones that act like clones

2019-03-09 Thread Rob
Thanks for clarifying, Vitalije. Yes, I'm the only one who would edit them 
and I don't use external editors, so clones would certainly be the easiest 
way to do that. I use \include{file.tex} for LaTeX documents, but don't 
know about a similar mechanism for html or css documents. Any of the other 
suggestions are way too complicated; especially compared to clones.


> As long as you are not using any other editor to edit those files and you 
> are the only one who edits them, it is safe to use cross-file clones for 
> this kind of problem.
>
>
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Not-clones that act like clones

2019-03-09 Thread vitalije


>
>
>- I could easily do that with cloned nodes. However, we are strongly 
>encouraged *not* to create cross-file clones.
>
> Any suggestions on how to accomplish that without using clones?
>
>
As long as you are not using any other editor to edit those files and you 
are the only one who edits them, it is safe to use cross-file clones for 
this kind of problem.

If you do use other editors you might accidentally change the content of 
some parts that should be same in all other files. But that risk won't be 
any less even if you don't use clones. At least Leo will warn you if those 
sections ever get out of sync. Keeping same content in several files, and 
keeping it synchronized is not a trivial task. Leo with clones can help you 
to manage this task reasonably safe.

You might look for other mechanisms of sharing text parts between files, 
like including one file in all others, or extending templates, defining 
constants, ...
Perhaps you can create intermediate files with Leo/or other editors and 
then use some kind of pre-processor/script to put the section content in 
all the final files.

Vitalije

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.