改造哈巴狗的管道?

Transform pipeline for pug?

用例是我有一个非常简单的 pug 文档。我需要创建两个文档...一个是原始文档,另一个混淆了 "private" 标签。为了以编程方式执行此操作,我需要访问权限才能遍历所有标签。哈巴狗 API 提供该功能吗?

h1 
  private Foobar
p
  Lorem ipsum

tags.pug

-
    let tags = [
        {
            tag: "h1",
            private: true,
            content: "private Foobar"
        },
        {
             tag: "p",
             content: "Lorem ipsum"
        }
    ]

public.pug

 include tags.pug

 each tag in tags
      if !tag.private
          ...etc

private.pug

 include tags.pug

 each tag in tags
      ...etc