tldr/pages/common/nokogiri.md

25 lines
553 B
Markdown
Raw Normal View History

2018-08-21 10:48:43 +01:00
# nokogiri
> An HTML, XML, SAX and Reader parser.
2019-06-04 10:00:11 +01:00
> More information: <https://nokogiri.org>.
2018-08-21 10:48:43 +01:00
- Parse the contents of a URL or file:
2018-08-21 10:48:43 +01:00
`nokogiri {{url|path/to/file}}`
- Parse as a specific type:
`nokogiri {{url|path/to/file}} --type {{xml|html}}`
2022-06-27 11:23:12 +01:00
- Load a specific initialization file before parsing:
2018-08-21 10:48:43 +01:00
`nokogiri {{url|path/to/file}} -C {{path/to/config_file}}`
- Parse using a specific encoding:
`nokogiri {{url|path/to/file}} --encoding {{encoding}}`
- Validate using a RELAX NG file:
`nokogiri {{url|path/to/file}} --rng {{url|path/to/file}}`