dash-docs/_includes/ref/bitcoin-core
David A. Harding 2c44b59d88
Dev Docs: Use Sed To Convert Tables To YAML
Run sed -i -f <this_file.sed> _includes/ref/bitcoin-core/rpcs/rpcs/* _includes/ref/bitcoin-core/rest/requests/get_* _includes/helpers/vars.md

    ## On lines that start with a pipe:
    /^|/ {
        ## Delete all table header/table body divider lines
        /|----/d;

        ## Escape all double quotes
        s/"/\\"/g;

        ## Replace lines that look like NTPD headers with a itemplate start block
        s/^| Name *| Type.*/{% itemplate ntpd1 %}/;

        ## Delete extraneous whitespace
        s/ *|/|/g;

        ## Replace the first pipe with "- name:" plus a start quote
        s/^| */- n: "/;

        ## Replace the remaining pipes, starting each one with a newline and two spaces
        s/| */"\n  t: "/;
        s/| */"\n  p: "/;
        s/| */"\n  d: "/;

        ## Add a close quote and an empty line after the last list item
        ## built from a single table row, except for the header row. This
        ## improves readability/maintainability
        /[^}]$/s/$/"\n/;
    }

    ## Replace the old table class with the itemplate close tag
    s/{:.ntpd}/{% enditemplate %}/
2015-02-20 15:39:10 -05:00
..
rest Dev Docs: Use Sed To Convert Tables To YAML 2015-02-20 15:39:10 -05:00
rpcs Dev Docs: Use Sed To Convert Tables To YAML 2015-02-20 15:39:10 -05:00
api-intro.md Dev Docs: Merge RPC and RPC Intro 2015-01-27 18:40:20 -05:00