leo学习系列之四——leo基础用法算子进阶

   1.Using chapters

Chapters are regions of a Leo outline whose root is an @chapter node. They are available in an outline if the @bool usechapters option is True. @chapter nodes may appear anywhere in an outline, but the create-chapter command (see below) creates @chapter nodes as children of the first @chapters (note the s) node in the outline.

One selects a chapter with the select-chapter command, after which Leo shows only the nodes in the selected chapter; in this respect, chapters are like hoists. The main chapter represents the entire outline and can not be deleted by name. When chapters are in effect, Leo creates an @chapters node for the use of create-chapter.

Associated settings:

  • The @bool use_chapters setting determines whether chapters are enabled.
  • The @bool use_chapter_tabs setting determines whether the chapters pop-up menu appears in the icon area. Choosing a chapter name from this list selects a chapter.

When chapters are enabled, the Cmds->Chapters menu shows all available chapter commands:

  • The chapter-create command creates an @chapter node and populates it with a single node.
  • The chapter-remove command deletes the currently selected chapter.
  • The chapter-select command prompts for a chapter name and makes only the nodes of the selected chapter visible.
  • The chapter-move-node-tochapter-clone-node-to and chapter-copy-node-to commands prompt for a chapter name and add the currently selected node (and its descendants) to another chapter.

看到上面有点难懂(英文不是很好),在full-command中使用命令也没用不能在第一个chapters上创建!现在给出我的实验用法
看图一目了然

当我将@@settings改为@setting时,章节失效!!
哦,原来是chapter-create,fuck!!!

  2.Using URLs

Leo highlights URLs whenever syntax is coloring is enabled.

Ctrl-Left-Click (open-url-under-cursor) opens the URL under the cursor.

The open-url command opens a URL appearing either in the headline or the first line of body text.

If a headline starts with @url, the rest of the headline is take to be a url.

Leo opens URLs that look like file names using os.startfile. 
Leo opens all other URLs with your default web browser. 
Any scheme (http, mailto, ftp, file, etc.) supported by your browser is valid.

URL’s should contain no spaces: use %20 instead of spaces. 
See the Appendix for a complete description of valid URLs.



以@url开始的节点,@url后面的文字为url地址,如果后面的不是url地址的话,以该节点的第一行为url地址!


   3.Clones

为什么需要克隆?
“If you are like me, you have a kind of knowledge base with infos gathered over time. And you have projects, where you use some of those infos. Now, with conventional outliners you begin to double these infos, because you want to have the infos needed for the project with your project. With Leo you can do this too, but if you change text in one place  it is updated in the other place too!  This is a feature I did not see with any other outliner (and I tried a few). Amazing! Leo directly supports the way I work!”—F. Geiger
克隆流程?

Please take a few moments to experiment with clones:

  • Create a node whose headline is A.
  • Ctrl-` (clone-node) clones node A.
  • Type some text into the body of A.
  • All clones of A now have the same body.
  • Insert a node, say B, as a child of any of the A nodes.
  • All the A nodes now have a B child.
  • See what happens if you clone B.
  • See what happens if you insert, delete or move nodes that are children of A.
  • When you delete a node’s penultimate clone, the last clone becomes a regular node again.
我的理解?
克隆就是指向同一个文件的两个链接



  4 Using abbreviations and templates

Leo optionally expands abbreviations as you type.

Abbreviations typically end with something like ”;;” so they won’t trigger by accident.

You define abbreviations in @data abbreviations nodes or @data global-abbreviations nodes. 
None come predefined, but leoSettings.leo contains example abbreviations in the node:

@@data abbreviations examples

Abbreviations can simply be shortcuts:

ncn;;=@nocolor

Abbreviations can span multiple lines. Continued lines start with \:, like this:

form;;=<form action="main_submit" method="get" accept-charset="utf-8">
\:<p><input type="submit" value="Continue &rarr;"></p>
\:</form>\n

Abbreviations can define templates in which <|a-field-name|> denotes a field to be filled in:

input;;=<input type="text/submit/hidden/button"
\:name="<|name|>"
\:value="" id="<|id|>">\n

Typing ”,,” after inserting a template selects the next field.

Abbreviations can execute abbreviation scripts, delimited by {|{ and }|}:

date;;={|{import time ; x=time.asctime()}|}
ts;;={|{import time ; x=time.strftime("%Y%m%d%H%M%S")}|}

For example, typing ts;; gives:

20131009171117

It’s even possible to define a context in which abbreviation scripts execute.

See leoSettings.leo for full details.


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
LEO(Log End Offset)是指副本底层log文件中下一条要写入的消息的位移。例如,如果LEO=10,那么当前文件已经写入了10条消息,位移范围是[0,10)。HW(High Watermark)是指所有分区已提交的位移,通常HW<=LEO。 对于多副本情况下,各个副本中的HW和LEO的演变过程如下:当Leader副本写入新的消息时,它会更新自己的LEO。Follower副本会从Leader副本中拉取消息,并更新自己的LEO为Leader副本的LEO值加1。同时,Follower副本还会更新自己的HW。更新HW的算法是比较当前LEO和Leader副本中传送过来的HW的值,然后取较小值作为自己的HW值。HW的更新会触发消费者端的位移提交和消息删除。 Kafka中的LEO和HW分别代表副本底层log文件中下一条要写入的消息的位移和所有分区已提交的位移。通过比较HW和消费者的位移,Kafka可以保证消息的顺序性。 关于分区器、序列化器和拦截器,分区器用于决定将消息发送到哪个分区,序列化器用于将消息对象序列化为字节流进行发送,拦截器则可以在消息发送前后进行一些处理。处理顺序是先经过拦截器,然后经过分区器和序列化器。 Kafka生产者客户端的整体结构包括一个或多个Producer线程、一个缓冲区、一个分区器、一个或多个拦截器和一个或多个序列化器。Producer线程负责将消息发送到Kafka集群中的Broker,缓冲区用于缓存待发送的消息,分区器决定消息被发送到哪个分区,序列化器将消息对象序列化为字节流进行发送,拦截器可以在消息发送前后进行一些处理。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值