帮助程序将笔记管理为一个充满文件的目录。

dendron-notesdir的Python项目详细描述


关于

注意:这是一个https://pypi.org/project/notesdir/的分支,用于添加与树突相关的功能

Notesdir是一个命令行工具,可帮助您管理存储为常规文件的注释。 它可以帮助:

  • 链接管理
    • 移动文件时更新对文件的引用和对文件的引用
    • 显示文件的链接和反向链接
  • 元数据管理
    • 通过适合文件类型的机制,在每个文件中存储标题、真实创建日期和标记
    • 以统一格式显示元数据
  • 查询
    • 查找带有或不带有特定标记的文件
  • 模板化
    • 编写Mako模板以快速创建新便笺
  • 组织
    • 用Python编写基于文件元数据或文件间关系组织目录的规则

哲学

  • 你可以使用任何你想要的编辑器。在
  • 注释不一定都必须是相同的文件格式。 Notesdir目前可以解析和更新Markdown、HTML和pdf;新的文件类型支持很容易添加;无法识别的文件类型可以和平共处。在
  • 你可以随意组织你的文件,也可以随意重组。在
  • 没有notesdir,您的笔记应该完全可用。 特别是,注释之间的链接只是常规的相对文件路径,许多文本编辑器、终端和浏览器都可以遵循这些路径。在
  • 您应该能够使用您想要的notesdir的功能。 我们的目标是更像一个库而不是一个框架。在
  • Notesdir的功能很容易编程使用。 pythonapi可以导入到您自己的脚本中。 CLI命令还具有将输出打印为JSON的选项。在

设置

  1. 安装Python3.7或更高版本
  2. 运行pip3 install notesdir
  3. 在主目录中创建.notesdir.conf.py文件:
fromnotesdir.confimport*conf=NotesdirConf(# SqliteRepo enables caching, which is important if you have more than a few dozen notes.# The sqlite database is just a cache: if you delete it, it'll be rebuilt the next time you# run notesdir (but that may take a while).repo_conf=SqliteRepoConf(# List the directories that contain your notes here.# These are searched recursively, you should not also list subdirectories.root_paths={'/Users/jacob/Zettel'},# Specify a path to store the cache in. The file will be created if it does not exist.# If you only have a handful of notes, you can use DirectRepoConf instead of SqliteRepoConf,# and omit this line.cache_path='/Users/jacob/local-only/notesdir-cache.sqlite3'),# This is an optional list of path globs where note templates can be found; it's used# by the `notesdir new` command.template_globs=["/Users/jacob/Zettel/*/templates/*.mako"])# This is optional. It determines the behavior of the `notesdir organize` command. This config sets# up a couple rules:# - If a file has title metadata, use that to set the filename, and use a limited set of characters#   in the filename# - If you have attachments organized into ".resources" dirs - for example,#   a file "foo.md" and "foo.md.resources/bar.png" - make sure the files in the resources dir move#   when the main file moves.defpath_organizer(info):path=rewrite_name_using_title(info)returnresource_path_fn(path)orpathconf.path_organizer=path_organizer# This is optional. It tells notesdir not to parse or edit certain files. I store attachments# to notes in directories named like `filename.resources`, and those attachments would never# contain metadata or links that I want to query or update, so I skip parsing those.# These files can still be moved by `organize`, and backlinks are still tracked for them.defskip_parse(parentpath,filename):returnfilename.endswith('.resources')conf.repo_conf.skip_parse=skip_parse

就这样! 您可以运行notesdir query来打印Notesdir当前知道的关于您的笔记的所有信息的列表。 (在您填写一些元数据之前,这可能是非常多的,也可能不是很多。) 第一次生成缓存时可能需要一段时间。在

请参阅full documentation了解所有功能的演练。在

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
并行处理java。util。同时发生的叉子在游泳池里。常见的并行性准则,用于选择正确的并行度大小   java如何将空白字符追加到指定长度?   安卓应用程序中出现错误,SSLHandshakeException,找不到证书路径的信任锚点   java如何使用JUnit Mockito验证检查方法是否未被调用   java如何使用不同的@RequestMapping解析多个控制器中的静态页面   Selenium中的javascript需要验证搜索结果   访问数据库SQLiteopenHelper方法时java应用程序崩溃(nullpointerexception)   在二叉树中验证最小堆时出现java空指针异常   Java 7的SSL连接失败   java用RestEasyWebTarget替换ProxyFactory不起作用   在Java应用程序中单击“否”按钮后,数组程序冻结(无响应)   数组中的前缀Java初学者前进和   Java HTML解析器,包括脚本标记和LineNumberReader   在java中为长类型数字加前导零   正则表达式无法映射正则表达式java。lang.IllegalArgumentException:模式段中捕获组的数量