1:改变布局
- 通过菜单命令:"Window/Toggle Split Direction" 设置
2:@file 标签(算子):输出文件
- 位置:节点中
- @file节点必须包含@others(如果有子节点),否则会报错!删除子节点之后,子节点不存在父节点的@file文件中,但是子节点的@nosent会包含在父节点的@file中
- @file 下的@nosent不输出文件
- 在Leo 载入时,自动的将 @file 指示的文件,从外部文件更新入Leo 文件了,在Leo 中进行了编辑保存时,也会自动更新外部文件
3:@ignore
- 保存时,不改变外部文件。此项一般要去除。
4:@others @all
-
在使用 @file 标签后,
-
可以简单的使用 @others标签来包含当前结点以下的所有结点
-
象XSL 中的<xsl:for-each select="//."> 哈哈哈
-
Copies the body text of all nodes except section definition nodes in an @file tree to the corresponding external file.
These control how Leo places text when writing external files. They are two of the most important directives in Leo.
@all
Copies all descendant nodes to the external file. Use @all to place unrelated data in an external file.
The @all directive is valid only in the body of @file trees.
Within the range of an @all directive, Leo ignores the @others directive and section references, so Leo will not complain about orphan nodes.
@others
Writes the body text of all unnamed descendant into the external file, in outline order.
Whitespace appearing before @others directive adds to the indentation of all nodes added by the @others directive.
A single node may contain only one @others directive, but descendant nodes may have other @others directives.
5:自动导入
-
Leo 的 File/Import.../Import To @file 命令,支持对 C/C++/C#;Java;Python;Perl...语言的自动分析文章化组织的导入
- 不过,自动生成的文本中可能有一些标签:
- {{{@ignore
@language python }}}
-
是不属于 @file 管理范围的,
- 只要简单的注释掉,就可以成为标准的,可以自动同步外部文件的文本结点对象了
6:<<section>>
-
在 @root限定处理下,各子结点的引用,与包含处理是使用 <<章节>> 标记
7:Tangle & Untangle
- 这时,针对外部文件的同步,需要人工操作
-
菜单命令:"File/Tangle.../Tangle" - 混出
-
菜单命令:"File/Untangle.../Untangle" - 混入
- 是一对相应的操作
- Tangle 是将当前的编辑混出到外部文件中
- Untangle 反之
-
8:@thin
大多数情况中 @thin 如同 @file 一样的工作. 实际上,你可以简单的将 @file 替换为 @thin 进行正常的 outline 操作.
这里是主要几点 @file 与 @thin 不同之处:
- Leo 不会在 .leo 文件的 @thin 节点树中保存信息
- 源自 @thin 的文件 (可以称作 "轻依赖"文件) 是从文件的outline 信息重建 @thin 树的. 具体的就是利用文本中 @+node 和 @-node 作为独特的标识节点
- . @all 指示符仅仅在 @thin 树中起作用. 此指示符与 @others 类似, 不过对其有些限制:(haoxiangbudui)
- 它将倒出所有标记以內的节点到文件中,包括标记为 @ignore 和 @others 以下的树会当作普通的孤立节点倒出. (不妙的体验是,原先 @others 可以限定下属节点倒出文本时的缩进,而@all 粗暴的将所有下级节点当作同级的兄弟处理了!)
9:@root vs. @file 树
@file 树比 @root 树使用起来方便很多:
- @file 树需要的指示符支持比 @root 树要少; 所有 @root 树中的章节都需要声明(而且不能重名,在同一文件中!), 而 @file 树常常包含很多非命名的章节节点. 在 @file 树中, @others 指示符 行为就象关联起所有非常命名的章节.
- 工作在 @root 树中,用户必须明确调用 Tangle 和 Untangle 命令. 而 Leo 会自动混入/出 @file 树 , 保存时混出所有变动到 outline, 重新打开 .loe 文件时自动混入所有修改从 outline.
但是, @root 树比 @file 树要 柔韧很多:
- 在 @file 树中, 章节必须是包含在子节点中的,而且引用点也是固定的.
- 在 @root 树中一个被声明的章节, 并不限制其可以在哪里被引用. 此外,@unit 指示符命令甚至于扩展了章节的引用, 可以不限制在一个 @root 树中! 即,你可以在一个 @root 中命名一个章节, 而在另一个 @root 树中引用(可以看作 节点的 clone 操作,只是在引用处看不到全部内容,除非混出为文件)
- 在 @root 中的章节声明,也不限制声明的地点.
@root 树与 @file 树不同之处在于:
-
只有 @root 树可以包含章节定义行(不过 @file 中可以使用 "<< class declarations >>"类声明的专用章节)
- 只有 @file 树可以包含 @others 指示符.
- @c 指示符 需要章节名出现在 @root 的节点标题树中.
- @c 指示符仅仅可以工作在 @file 树的体文本起始处.所谓 体文本是在 @root 中没有标记会被忽略,而在 @file 树是作为无命名的代码章节内容处理的节点正文文本.
The following table summarizes the various ways of creating external files.
Kind | Sentinels in external file? | Sections and @others expanded on write? | File data stored in .leo file? |
@asis | no | no | yes |
@auto | no | yes | no |
@edit | no | no | no |
@nosent | no | yes | yes |
@shadow | Note 1 | yes | no |
@file @thin Note 2 | yes | yes | no |
Note 1: @shadow nodes create two files, a public file without sentinels and a private file with sentinels.
Note 2: @file and @thin nodes are synonyms.
- 经体验, 可以简单的使用 @nosent 替换 @root ,可以象 @file 一样的使用,却又没有Python格式的注释的结构信息
- 而且,@others 章节声明也可以很好的混同使用
-
只是不能象 @root 那样在正文中使用@root expfile.t2t 模式的声明,而必须在 outline 树节点中显要的指明
-
如此就可以使用 Leo 方便的管理,编辑不支持 # 为注释的各种语言文件了
- 嗯嗯 ? 只是可惜的是这样一来,所有代码只能安全的存储在 .leo 文件中,生成的代码文件是干净了,但是团队开发时,就要反复同步 .leo 文件,否则,难以快速把握哪些文件受到修改了…………
10:@asis <path>
@button
-
You can bind keys to the commands created by script buttons:
@color
Enables syntax coloring until the next @nocolor directive.
@killcolor
Disables syntax coloring in a node, overriding all @color, @nocolor or @nocolor-node directives in the same node.
@nocolor
Disables syntax coloring until the next @nocolor directive.
@nocolor-node
Disables coloring for only the node containing it. The @nocolor-node directive overrides the @color and @nocolor directives within the same node.
@ and @doc
These directives start a doc part. @doc is a synonym for @. Doc parts continue until an @c directive or the end of the body text. For example:
When writing external files, Leo writes doc parts as comments.
Leo does not recognize @ or @doc in @asis trees or when the @all or @delims directives are in effect.
@c and @code
Ends any doc part and starts a code part.
@code is a deprecated synonym for @c.
Leo does not recognize this directive in @asis trees or when the @all or @raw directives are
@encoding <encoding>
Specifies the Unicode encoding for an external file. For example:
When reading external files, the encoding given must match the encoding actually used in the external file or “byte hash” will result.
@first <text>
Places lines at the very start of an external file, before any Leo sentinels. @first lines must be the very first lines in an @<file> node. More then one @first lines may appear.
This creates two first lines, a shebang line and a Python encoding line:
Here is a perl example:
@last <text>
Places lines at the very end of external files.
This directive must occur at the very end of top-level @<file> nodes. More than one @last directive may exist. For example:
Leo does not recognize @last directive in @asis trees.
@ignore 忽略节点
Tells Leo to ignore the subtree in which it appears.
In the body text of most top-level @<file> nodes, the @ignore directive causes Leo not to write the tree. However, Leo ignores @ignore directives in @asis trees.
Plugins and other parts of Leo sometimes @ignore for their own purposes. For example, Leo’s unit testing commands will ignore trees containing @ignore. In such cases, the @ignore directive may appear in the headline or body text.
@edit <path>
The @edit directive imports an external file into a single node.
When reading @edit nodes, Leo reads the entire file into the @edit node. Lines that look like sentinels will be read just as they are.
When writing @edit nodes, @edit nodes must not have children and section references and @others are not allowed.
@shadow <path>
The @shadow directive creates two external files, a public file without sentinels, and a private file containing sentinels.
When reading an @shadow node, Leo uses a brilliant algorithm devised by Bernhard Mulder that compares the public and private files, and then updates the outline based on changes to the public file. In this way, @shadow provides many of the benefits of @file trees without writing sentinels in the (public) external file.
Leo can do an initial import of @shadow trees by parsing the corresponding public file, exactly as is done for @auto nodes.
@pagewidth <n>
Sets the page width used to break doc parts into lines. <n> should be a positive integer. For example:
The @pagewidth directive overrides the @int page_width setting.
@tabwidth <n>
Sets the width of tabs. Negative tab widths cause Leo to convert tabs to spaces.
@int page_width=60 节点上
@string target_language=rest 节点上
@language <language name>
Specifies the language in effect, including comment delimiters. If no @language directive is in effect, Leo uses the defaults specified by the @string target-language setting.
A node may contain at most one @language directive.
The valid language names are: actionscript, ada, autohotkey, batch, c, config, cpp, csharp, css, cweb, elisp, forth, fortran, fortran90, haskell, haxe, html, ini, java, javascript, kshell, latex, lua, noweb, pascal, perl, perlpod, php, plain, plsql, python, rapidq, rebol, rest, rst, ruby, shell, tcltk, tex, unknown, unknown_language, vim, vimoutline, xml, xslt.
Note: Shell files have comments that start with #.
Case is ignored in the language names. For example, the following are equivalent:
The @language directive also controls syntax coloring. For language x, the file leo/modes/x.py describes how to colorize the language. To see the languages presently supported, look in the leo/modes directory. There are over 100 such languages.
@lineending cr/lf/nl/crlf
Sets the line endings for external files. This directive overrides the @string output_newline setting.
The valid forms of the @lineending directive are:
@lineending nl The default, Linux. @lineending cr Mac @lineending crlf Windows @lineending lf Same as ‘nl’, not recommended @lineending platform Same as platform value for output_newline setting.
@path <path>
Sets the path prefix for relative filenames for all @<file> tree.(@nosent也管用呀)
This directive may appear in headlines or body text, and may appear in top-level @<file> nodes.
The path is an absolute path if it begins with c:\ or /, otherwise the path is a relative paths.
Multiple @path directives may contribute to the path prefix. Absolute paths overrides any ancestor @path directives. Relative paths add to the path prefix.
If no @path directives are in effect, the default path prefix is the directory containing the .leo file.
Within @path and @<file> paths, {{exp}} gets evaluated with the following symbols known: c, g, p, os and sys. For example:
refers to the file abc.py in (absolute path of) the current directory.
@wrap
Enables line wrapping in Leo’s body pane.
Only the first @wrap or @nowrap directive in a node has any effect.
@wrap may appear in either headlines or body text.
@nowrap
Disables line wrapping the Leo’s body pane.
Only the first @wrap or @nowrap directive in a node has any effect.
@nowrap may appear in either headlines or body text.
@raw and @end_raw
@raw starts a section of “raw” text that ends only with the @end_raw directive or the end of the body text containing the @raw directive. Within this range, Leo ignores all section references and directives, and Leo generates no additional leading whitespace.