WIKI_ROOT = "WatchmanOSS"

# Generated by hand by running:
#
# ```
# ~/fbsource/fbcode/watchman$ find oss/website/ -name \*.md | sed -e 's#\(.*\)#    "\1",#'
# ```
#
# And pasting the results in here. This is not great, but T126120311 should
# fix this.
ALL_SRCS = [
    "oss/website/README.md",
    "oss/website/_docs/expr.allof.md",
    "oss/website/_docs/expr.anyof.md",
    "oss/website/_docs/expr.dirname.md",
    "oss/website/_docs/expr.empty.md",
    "oss/website/_docs/expr.exists.md",
    "oss/website/_docs/expr.false.md",
    "oss/website/_docs/expr.match.md",
    "oss/website/_docs/expr.name.md",
    "oss/website/_docs/expr.not.md",
    "oss/website/_docs/expr.pcre.md",
    "oss/website/_docs/expr.since.md",
    "oss/website/_docs/expr.size.md",
    "oss/website/_docs/expr.suffix.md",
    "oss/website/_docs/expr.true.md",
    "oss/website/_docs/expr.type.md",
    "oss/website/_docs/file-query.md",
    "oss/website/_docs/scm-query.md",
    "oss/website/_docs/simple-query.md",
    "oss/website/_docs/watchman-make.md",
    "oss/website/_docs/watchman-replicate-subscription.md",
    "oss/website/_docs/watchman-wait.md",
]

def create_rule(src):
    root = WIKI_ROOT
    if src.startswith("oss/website/_docs/"):
        root += "/docs"

    publish(
        wiki_root_path = root,
        srcs = [src],
        oncall = "codehub_markdown",
    )

[create_rule(src) for src in ALL_SRCS]
