Merge pull request #189 from niklasmohrin/simplify_highlight_commands

Refactor formatting code
This commit is contained in:
Danilo Bargen 2021-09-12 20:31:45 +02:00 committed by GitHub
commit a811788b31
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 407 additions and 162 deletions

32
tests/chmod.ru.expected Normal file
View file

@ -0,0 +1,32 @@
Изменить права доступа файлу или папке.
Больше информации: <https://www.gnu.org/software/coreutils/chmod>.
Дать [u]пользователю, который владеет файлом, права на его [x]исполнение:
 chmod u+x файл
Дать права [u]пользователю права [r]чтения и [w]записи в файл/папку:
 chmod u+rw файл_или_папка
Убрать права на [x]исполнение у [g]группы:
 chmod g-x файл
Дать [a]всем пользователям права на [r]чтение и [x]исполенеие:
 chmod a+rx файл
Дать [o]другим (не из группы владельцев файлом) такие же права как и у [g]группы:
 chmod o=g файл
Убрать все права у [o]других:
 chmod o= файл
Изменить права рекурсивно, дав [g]группе и [o]другим возможность [w]записи в папку:
 chmod -R g+w,o+w папка

32
tests/chmod.ru.md Normal file
View file

@ -0,0 +1,32 @@
# chmod
> Изменить права доступа файлу или папке.
> Больше информации: <https://www.gnu.org/software/coreutils/chmod>.
- Дать [u]пользователю, который владеет файлом, права на его [x]исполнение:
`chmod u+x {{файл}}`
- Дать права [u]пользователю права [r]чтения и [w]записи в файл/папку:
`chmod u+rw {{файл_или_папка}}`
- Убрать права на [x]исполнение у [g]группы:
`chmod g-x {{файл}}`
- Дать [a]всем пользователям права на [r]чтение и [x]исполенеие:
`chmod a+rx {{файл}}`
- Дать [o]другим (не из группы владельцев файлом) такие же права как и у [g]группы:
`chmod o=g {{файл}}`
- Убрать все права у [o]других:
`chmod o= {{файл}}`
- Изменить права рекурсивно, дав [g]группе и [o]другим возможность [w]записи в папку:
`chmod -R g+w,o+w {{папка}}`

View file

@ -4,29 +4,29 @@
Open an SVG file in the Inkscape GUI:
inkscape filename.svg
 inkscape filename.svg
Export an SVG file into a bitmap with the default format (PNG) and the default resolution (90 DPI):
inkscape filename.svg -e filename.png
 inkscape filename.svg -e filename.png
Export an SVG file into a bitmap of 600x400 pixels (aspect ratio distortion may occur):
inkscape filename.svg -e filename.png -w 600 -h 400
 inkscape filename.svg -e filename.png -w 600 -h 400
Export a single object, given its ID, into a bitmap:
inkscape filename.svg -i id -e object.png
 inkscape filename.svg -i id -e object.png
Export an SVG document to PDF, converting all texts to paths:
inkscape filename.svg | inkscape | inkscape --export-pdf=inkscape.pdf | inkscape | inkscape --export-text-to-path
 inkscape filename.svg | inkscape | inkscape --export-pdf=inkscape.pdf | inkscape | inkscape --export-text-to-path
Duplicate the object with id="path123", rotate the duplicate 90 degrees, save the file, and quit Inkscape:
inkscape filename.svg --select=path123 --verb=EditDuplicate --verb=ObjectRotate90 --verb=FileSave --verb=FileQuit
 inkscape filename.svg --select=path123 --verb=EditDuplicate --verb=ObjectRotate90 --verb=FileSave --verb=FileQuit
Some invalid command just to test the correct highlighting of the command name:
inkscape --use-inkscape=v3.0 file
 inkscape --use-inkscape=v3.0 file

View file

@ -406,6 +406,16 @@ fn test_rendering_color_never() {
);
}
#[test]
fn test_rendering_i18n() {
_test_correct_rendering(
include_str!("chmod.ru.md"),
"chmod.ru.md",
include_str!("chmod.ru.expected"),
"always",
);
}
/// An end-to-end integration test for rendering with custom syntax config.
#[test]
fn test_correct_rendering_with_config() {