GithubHelp home page GithubHelp logo

Comments (6)

harttle avatar harttle commented on June 3, 2024

我发现这是 yargs 参数解析的一个问题,这个命令特殊在 '-' 上,它会被认为是一个新参数而不是一个值。你可以改成这样:

find "$(pwd)" -type f -name "*.md" | npx md-padding@latest --ignore-words='-' ':' -f --read-files -i

注意 '-' 前面空格变成了等号。

from md-padding.

ykla avatar ykla commented on June 3, 2024

你好,我在指定下列参数运行后,大于号可以正确处理,小于号 < 则不行。

find "$(pwd)" -type f -name "*.md" | npx md-padding --ignore-words='-' ':' '>' '<' -f --read-files -i

另外似乎运行时不需要加 @latest,反而会报告警告找不到版本。

另外能否增加一个功能:即指定跳过对文档某标题以后的(或者跳过标题 xx 到标题 xx 之间的内容不处理)内容。例如跳过标题 ## Bibliography 这一行标题后边的所有内容。

非常感谢。

from md-padding.

harttle avatar harttle commented on June 3, 2024

试试这个: https://github.com/harttle/md-padding?tab=readme-ov-file#%E5%BF%BD%E7%95%A5%E7%89%87%E6%AE%B5

from md-padding.

ykla avatar ykla commented on June 3, 2024

你好,又发现对等于号不生效。

Run find "$(pwd)" -type f -name "*.md" | npx md-padding --ignore-words='-' `=` ':' '>' '<' -f  --read-files -i
/home/runner/work/_temp/c7d98935-f621-[4](https://github.com/taophilosophy/SEP-CN/actions/runs/9039422434/job/24842230924#step:5:5)bac-b21a-a16b36ddb1b2.sh: line 1: =: command not found
/opt/hostedtoolcache/node/20.12.2/x64/lib/node_modules/md-padding/dist/parser/parse.js:239
                throw new Error(`unmatched ${RAW_BEGIN} at ${i}`);
                ^

Error: unmatched <!--md-padding-ignore-begin--> at 9362
    at parse (/opt/hostedtoolcache/node/20.12.2/x64/lib/node_modules/md-padding/dist/parser/parse.js:239:23)
    at padMarkdown (/opt/hostedtoolcache/node/20.12.2/x64/lib/node_modules/md-padding/dist/transformers/pad-markdown.js:9:3[5](https://github.com/taophilosophy/SEP-CN/actions/runs/9039422434/job/24842230924#step:5:6))
    at Object.<anonymous> (/opt/hostedtoolcache/node/20.12.2/x64/lib/node_modules/md-padding/dist/bin/md-padding.js:37:44)
    at Module._compile (node:internal/modules/cjs/loader:13[6](https://github.com/taophilosophy/SEP-CN/actions/runs/9039422434/job/24842230924#step:5:7)9:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:142[7](https://github.com/taophilosophy/SEP-CN/actions/runs/9039422434/job/24842230924#step:5:8):10)
    at Module.load (node:internal/modules/cjs/loader:1206:32)
    at Module._load (node:internal/modules/cjs/loader:1022:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12)
    at node:internal/main/run_main_module:2[8](https://github.com/taophilosophy/SEP-CN/actions/runs/9039422434/job/24842230924#step:5:9):4[9](https://github.com/taophilosophy/SEP-CN/actions/runs/9039422434/job/24842230924#step:5:10)

去掉等于号参数后,仍然报错:

Run find "$(pwd)" -type f -name "*.md" | npx md-padding --ignore-words='-' ':' '>' '<' -f  --read-files -i
  
/opt/hostedtoolcache/node/20.12.2/x6[4](https://github.com/taophilosophy/SEP-CN/actions/runs/9039451903/job/24842307346#step:5:4)/lib/node_modules/md-padding/dist/parser/parse.js:239
                throw new Error(`unmatched ${RAW_BEGIN} at ${i}`);
                ^
Error: unmatched <!--md-padding-ignore-begin--> at 9362
    at parse (/opt/hostedtoolcache/node/20.12.2/x6[4](https://github.com/taophilosophy/SEP-CN/actions/runs/9039451903/job/24842307346#step:5:5)/lib/node_modules/md-padding/dist/parser/parse.js:239:23)
    at padMarkdown (/opt/hostedtoolcache/node/20.12.2/x64/lib/node_modules/md-padding/dist/transformers/pad-markdown.js:9:3[5](https://github.com/taophilosophy/SEP-CN/actions/runs/9039451903/job/24842307346#step:5:6))
    at Object.<anonymous> (/opt/hostedtoolcache/node/20.12.2/x[6](https://github.com/taophilosophy/SEP-CN/actions/runs/9039451903/job/24842307346#step:5:7)4/lib/node_modules/md-padding/dist/bin/md-padding.js:3[7](https://github.com/taophilosophy/SEP-CN/actions/runs/9039451903/job/24842307346#step:5:8):44)
    at Module._compile (node:internal/modules/cjs/loader:1369:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1427:10)
    at Module.load (node:internal/modules/cjs/loader:1206:32)
    at Module._load (node:internal/modules/cjs/loader:1022:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12)
    at node:internal/main/run_main_module:2[8](https://github.com/taophilosophy/SEP-CN/actions/runs/9039451903/job/24842307346#step:5:9):49
Node.js v20.12.2

去掉所有忽略参数:

Run find "$(pwd)" -type f -name "*.md" | npx md-padding --read-files -i
  
/opt/hostedtoolcache/node/20.12.2/x6[4](https://github.com/taophilosophy/SEP-CN/actions/runs/9039493875/job/24842421042#step:5:4)/lib/node_modules/md-padding/dist/parser/parse.js:239
                throw new Error(`unmatched ${RAW_BEGIN} at ${i}`);
                ^
Error: unmatched <!--md-padding-ignore-begin--> at 9362
    at parse (/opt/hostedtoolcache/node/20.12.2/x6[4](https://github.com/taophilosophy/SEP-CN/actions/runs/9039493875/job/24842421042#step:5:5)/lib/node_modules/md-padding/dist/parser/parse.js:239:23)
    at padMarkdown (/opt/hostedtoolcache/node/20.12.2/x64/lib/node_modules/md-padding/dist/transformers/pad-markdown.js:9:3[5](https://github.com/taophilosophy/SEP-CN/actions/runs/9039493875/job/24842421042#step:5:6))
    at Object.<anonymous> (/opt/hostedtoolcache/node/20.12.2/x[6](https://github.com/taophilosophy/SEP-CN/actions/runs/9039493875/job/24842421042#step:5:7)4/lib/node_modules/md-padding/dist/bin/md-padding.js:3[7](https://github.com/taophilosophy/SEP-CN/actions/runs/9039493875/job/24842421042#step:5:8):44)
    at Module._compile (node:internal/modules/cjs/loader:1369:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1427:10)
    at Module.load (node:internal/modules/cjs/loader:1206:32)
    at Module._load (node:internal/modules/cjs/loader:1022:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12)
    at node:internal/main/run_main_module:2[8](https://github.com/taophilosophy/SEP-CN/actions/runs/9039493875/job/24842421042#step:5:9):49
Node.js v20.12.2
Error: Process completed with exit code 1.

from md-padding.

harttle avatar harttle commented on June 3, 2024

又发现对等于号不生效。

等号你写成命令调用了,要用引号 '='

unmatched <!--md-padding-ignore-begin-->

这是因为没找到对应的 <!--md-padding-ignore-end-->,如果写了还有问题,请发一个完整的文件来

from md-padding.

ykla avatar ykla commented on June 3, 2024

好的,可以运行了。

from md-padding.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.