Commit graph

332 commits

Author SHA1 Message Date
Danilo Bargen
9eca2fe5db Update copyright year 2021-10-16 13:06:28 +02:00
Tsvetomir Bonev
3f49100307
Docs: Add funtoo package to list (#208) 2021-10-03 16:10:30 +02:00
Danilo Bargen
e84fce6f90
Use tree-style imports (#204) 2021-09-13 09:06:21 +02:00
Danilo Bargen
b0449dc6bf
Merge pull request #203 from dbrgn/update-deps
Update dependencies
2021-09-12 23:29:06 +02:00
Danilo Bargen
07dc5c6bf4 Upgrade predicates and assert_cmd: 1 → 2 2021-09-12 21:12:00 +02:00
Danilo Bargen
85ab38d892 Remove dev dependency on remove_dir_all
It's a transitive dependency of the `tempdir` crate. It was pinned to a
specific version to achieve compatibility with Rust 1.39, but we now run
on 1.53.
2021-09-12 21:06:06 +02:00
Danilo Bargen
7aa111e727 Upgrade reqwest: 0.10 → 0.11
This increases the release binary size by 144 KiB, but it reduces the
number of transitive dependencies from 152 to 140.
2021-09-12 20:56:24 +02:00
Danilo Bargen
b359fd8e5b Upgrade pager: 0.15 → 0.16 2021-09-12 20:42:10 +02:00
Danilo Bargen
4376162914 Upgrade env_logger: 0.7 → 0.9 2021-09-12 20:40:08 +02:00
Danilo Bargen
ffc30d1243 Run cargo update 2021-09-12 20:35:00 +02:00
Danilo Bargen
a811788b31
Merge pull request #189 from niklasmohrin/simplify_highlight_commands
Refactor formatting code
2021-09-12 20:31:45 +02:00
Danny Mösch
1471b1d97b
Create cache directory path if it does not exist (#174)
Fixes #167
2021-09-12 20:28:22 +02:00
Niklas Mohrin
3ac087ae41
Final touches for formatting refactor
- Rename: `yield_snippet` => `process_snippet`
- Rename: `HighlightingSnippet` => `PageSnippet`
2021-09-08 15:02:25 +02:00
Niklas Mohrin
b216a63c64
Add integration test for non-ascii page rendering
Although this did not fail on old master, it is still an important case
to test. Actually, this test doesn't even break when introducing some
errors that fail i18n unit tests, unless the command name itself is
non-ascii.
2021-09-08 14:44:10 +02:00
Niklas Mohrin
22baa455b5
Update inkscape-default.expected 2021-09-08 14:44:09 +02:00
Niklas Mohrin
743998a75f
Reorder functions in formatter.rs
As someone reading this file for the first time, I would want to see the
only public and most general function first and find the specifics
further down instead of having to look for the "module entry" first.
2021-09-08 14:44:09 +02:00
Niklas Mohrin
808ad7ff30
Extract output logic for pages into own module
This moves `print_page` from `main.rs` and `print_snippet` from
`formatter.rs` into a new file `output.rs`. To decompose `print_snippet`
from `print_lines`, the latter now takes the `yield_snippet` callable as
an argument (similar to how the helper methods got a hold of it). In
order for this to work, callers have to provide a function that is
generic over all possible snippet lifetimes.
2021-09-08 14:40:32 +02:00
Niklas Mohrin
e8b1c9e801
Rename Tokenizer to LineIterator
This also replaces the `next_token` method with the `next` method from
the `Iterator` trait.
2021-09-08 14:39:57 +02:00
Niklas Mohrin
62e82461cb
Refactor most of formatter.rs
This includes
- adding the `HighlightingSnippet` enum as a common ground for
  highlighting and printing code to communicate
- decomposing `print_lines` accordingly
- clearing up `highlight_code_segment` (previously `highlight_command`)
- adding unit tests (now that they can reason about
  `HighlightingSnippet`s instead of having to output on the integration
  test level
2021-09-08 14:39:51 +02:00
Niklas Mohrin
cdbca5c53b
Add FindFrom extension trait to str to start searching at a byte offset.
This also moves the contents of `dedup.rs` into a shared module `extensions`.
2021-09-08 14:38:31 +02:00
Danilo Bargen
49f2f8a3dd Mention italic styling in docs 2021-09-06 17:02:53 +02:00
Wesley Klop
8051c3169a
Implement support for italics (#197)
Closes #146.
2021-09-06 17:01:55 +02:00
Danilo Bargen
4e0d497347
Merge pull request #201 from tranzystorek-io/refactor-misc
Add various small refactorings
2021-08-29 16:53:04 +02:00
Marcin Puc
a4ac910e86 Add various small refactorings 2021-08-29 16:12:24 +02:00
Marcin Puc
9ac67ec562 Bump CI toolchain to 1.53 2021-08-29 16:11:46 +02:00
Niklas Mohrin
d5d3d20451
Run clippy on stable with msrv setting instead of on msrv (#200) 2021-08-17 19:40:35 +02:00
Niklas Mohrin
123c809630
Merge pull request #163 from niklasmohrin/hyperfine 2021-07-30 15:46:03 +02:00
Niklas Mohrin
d1d36a961a
Update README.md to include updated benchmark results 2021-07-30 15:31:46 +02:00
Niklas Mohrin
e7c5daa9b7
Add Dockerfile for benchmarks 2021-07-30 15:31:17 +02:00
Rithvik Vibhu
187214e39e
Remove AUR links for tealdeer and tealdeer-bin (#196)
The package is now in the community repos.
2021-07-19 13:57:16 +02:00
bl-ue
a5aa822d12
README: Update @SShrike → @severen (#193) 2021-06-22 13:31:51 +02:00
Danilo Bargen
767b62d493
Merge pull request #187 from sondr3/performance-fixes
- Use unbuffered I/O for faster printing to stdout
- Replace OpenSSL with Rustls
2021-05-26 09:40:58 +02:00
Sondre Nilsen
feb20d8c5c Add WriteError type, convert print_lines to return a result 2021-05-25 16:38:28 +02:00
Sondre Nilsen
22693c09ba Use rustls for TLS to avoid dynamic linking 2021-05-25 16:38:00 +02:00
Sondre Nilsen
06f771f64d Use unbuffered IO for faster printing to stdout 2021-05-25 16:37:57 +02:00
Danilo Bargen
a72ba4a7a9
Merge pull request #191 from dbrgn/msrv
Update MSRV policy
2021-05-13 14:45:05 +02:00
Danilo Bargen
e32ce77c0c CI: Bump Rust version 2021-05-13 14:31:22 +02:00
Danny Mösch
b6342633cd
Use which instead of tar as reference tldr page in tests (#192)
The page for `tar` changes pretty frequently. `which` was last updated in 2018 and is a rather simple command overall. So it is less likely that the reference in the repository has to be updated as often as the one for `tar`.
2021-05-13 14:12:11 +02:00
Cameron Tod
25f736564d
Docs: Fix packet/package typo (#185) 2021-05-13 00:25:41 +02:00
Danilo Bargen
3223fec5ee Update MSRV policy
As discussed in #190.
2021-05-13 00:06:45 +02:00
Dalton
4d4c7b6a5d
Fix clippy warnings (#188)
* Fix clippy warnings
* Update toolchain for CI workflows fmt and clippy
2021-05-11 13:28:26 +02:00
Dalton
388deac079
Send all progress logging messages to stderr (#171)
- Change logging messages to go to stderr
- Updated tests to expect these messages in stderr instead of stdout
- Changed test_markdown_rendering to no longer rely on the tldr pages repo
2021-05-10 09:17:13 +02:00
Danny Mösch
a92e974ac2
Update expected output for 'tar' tldr page (#186) 2021-05-09 18:05:50 +02:00
Dalton
0fce79f8ed
Add unit tests for custom pages / patches (#183) 2021-04-23 20:06:44 +02:00
ギャラ
42816d3d09
Fix order of derive helper attributes (#179) 2021-04-19 15:09:07 +02:00
Danny Mösch
2a304b17f2
Fix clippy warnings (#173) 2021-04-18 19:27:25 +02:00
Dalton
07c715656f
Support custom pages and patches (#142)
Allow adding, overriding and extending custom pages.

Fixes #98.
2021-04-18 19:22:41 +02:00
Danny Mösch
7232bdd898
Allow SunOS override (#176)
Fixes #82.
2021-04-14 20:55:27 +02:00
Danny Mösch
49f151a605
Remove 'extern crate' declarations (#175)
Cargo.toml specifies Rust Edition 2018 which does not require 'extern crate' anymore.
2021-04-10 21:33:48 +02:00
Michael Cho
071680800a
zsh-completion: fix issue with [.md, add basic -L completion, remove extra _files args (#168)
- Use array `commands=(...)` and `_describe` to deal with '[.md' & empty cache scenario.  Fixes #166
- Hide `tldr --list` stderr (`2>/dev/null`) which breaks completion with empty cache
- Remove `sed` since #112 changed commas to newlines
- Add new `sed`-equivalent replacement (`:` -> `\:`) using native [ZSH `${name//pattern/repl}`](http://zsh.sourceforge.net/Doc/Release/Expansion.html#Parameter-Expansion) since colon is special character in ZSH completions
- Add basic support for `-L, --language` flag from #125. In future, can consider adding extra completions maybe based on caches `pages.{lang}` folders.
- Remove extraneous completion of file names for positional arguments (i.e. `'*:file:_files'`)
2021-03-21 15:55:23 +01:00