Commit graph

37 commits

Author SHA1 Message Date
Eric Huss
a4140ba535 Remove clap macro_use
This removes the macro_use for clap just because I'm not a big fan of
glob-style imports like this. I think being a little more explicit here
makes it a little clearer where these macros come from.
2025-09-12 06:49:54 -07:00
Eric Huss
3e673ce424 Switch from log to tracing
This switches to using the tracing crate instead of log. Tracing
provides a lot of nice features which we can take advantage of moving
forward.

This also adjusts the output fairly significantly. This includes:

- Switched the environment variable from RUST_LOG to MDBOOK_LOG.
- Dropped the timestamp. I experimented with various different time
  displays, but ultimately decided to omit it for now. I don't think
  I've ever found it to be useful, and it takes up a very significant
  amount of space. It could potentially be useful for basic profiling,
  but I think there are other, better mechanisms for that. We could
  consider leveraging tracing itself for doing some basic profiling
  (like using something like tracing-chrome).
- Dropped the target unless MDBOOK_LOG is set. The target tends to be
  pretty noisy, and doesn't really convey much information unless you
  are debugging or otherwise trying to adjust the log output.
- Added color.
- Slightly reworked the way the error cause trace is displayed.
- Slightly changed the way html5ever filtering is done, as well as add
  handlebars to the list since they both are very noisy. You can
  override this now by explicitly listing them as targets.

I still expect that mdbook will eventually change how it displays things
to the console, possibly switching away from tracing and printing things
itself. However, that is a larger project for the future.
2025-09-12 06:13:45 -07:00
Eric Huss
f6c062fc98 Enable unreachable_pub
This lint can help make it clearer which items are actually exposed in
the public API.
2025-07-25 09:02:55 -07:00
Eric Huss
fc76a47d6e Finish move of utils to mdbook-core
This updates everything for the move of utils to mdbook-core. There will
be followup commits that will be moving and refactoring these utils.
This simply moves them over unchanged (except visibility).
2025-07-23 17:29:55 -07:00
Eric Huss
5264074c1b Move common lint controls to Cargo.toml
This moves lint overrides to Cargo.toml so that they can more easily be
shared across crates.
2025-07-23 17:29:12 -07:00
David
87a381e0a7 upgrade clap to 4.0 2022-12-14 17:11:08 -08:00
ISSOtm
42129c6181 Always open index page with serve --open 2022-07-01 09:01:25 +02:00
josh rotenberg
5d65967448 add first_chapter function 2022-05-10 11:16:22 -07:00
Ed Page
1e1c99bbdb refactor: Move from deprecated GlobalVersion 2022-03-28 13:06:50 -05:00
Ed Page
0c89293029 refactor: Move from deprecated ColoredHelp 2022-03-28 13:06:50 -05:00
Ed Page
39eb78c88b refactor: Move from deprecated SubCommand 2022-03-28 13:06:50 -05:00
Ed Page
372842aac6 refactor: Move from deprecated Arg::with_name 2022-03-28 13:06:50 -05:00
Ed Page
7934e06668 chore: Upgrade to clap3 2022-03-28 13:06:50 -05:00
Johannes Stoelp
ff4b8e7a8d switch from open to opener
By default, `opener` launches the subprocess without waiting for its
completion, compared to `open` which waits for its completion.

This is helpful in case the `watch` feature is enabled and one of the
following commands `watch | serve --open` is used. If this command would
open the browser, listening for changes would be blocked by the browser.
2021-09-26 12:33:09 -07:00
apogeeoak
3f9f681b9e Update open crate to latest version. 2021-09-06 15:52:43 -04:00
Alexandru Macovei
beec17e55d Add ability to generate shell completions via clap 2021-01-04 23:51:02 +02:00
Steve Klabnik
f79d5d4582 rust-lang-nursery -> rust-lang
Fixes #1080
2019-10-29 08:04:16 -05:00
Lzu Tao
672cf456eb Remove unnecessary ::<crate>
Find and replace with `git grep -E '\W::[a-z]'` command.
2019-05-30 23:12:33 +07:00
lzutao
71281bff10 Update some updatable dependencies (#934)
* Update ammonia dependency

* Update env_logger

* Update itertools

* Update ws dep

* Update pretty_assertions dep
2019-05-26 14:05:42 +02:00
lzutao
8542f7f29d Transition to 2018 edition (#933)
* Transition to 2018 edition

* Update Travis CI badge in README

* Remove non-idiomatic `extern crate` lines
2019-05-25 20:50:41 +02:00
Dylan DPC
a647017e4b
Merge pull request #861 from k-nasa/add_colored_help
Add colored help
2019-04-25 23:19:18 +02:00
k-nasa
7e52da3c1b Add colored help 2018-12-25 21:35:37 +09:00
k-nasa
78ee8e43bb Fix duplication with Cargo.toml 2018-12-25 21:10:07 +09:00
Bas Bossink
991a725c26 Solve the simplest clippy warnings and run rustfmt 2018-12-04 00:10:09 +01:00
Matt Ickstadt
b8f8e76899 Improve command-line argument parsing 2018-08-02 16:52:41 -05:00
Matt Ickstadt
f300a21a47 Move subcommand modules to match cargo conventions 2018-07-24 16:34:49 -05:00
Mathieu David
e725215103 Add rustdoc generated API doc 2015-08-06 12:38:48 +02:00
Mathieu David
9b4298c066 Initial implementation for reading the config file: book.json #7 2015-08-03 01:37:13 +02:00
Kevin K
c7361704b9 uses clap to simplify CLI 2015-08-01 00:59:05 -04:00
Mathieu David
7fa5b06ccb Rudimentary: Parse SUMMARY.md, support for nested levels. Only list items: "- [name](path)" or "* [name](path)" #2 2015-07-18 00:04:20 +02:00
Mathieu David
4fe0bc2de5 renamed directory + created BookItem 2015-07-16 19:26:16 +02:00
Mathieu David
ad01c37432 clean up structure and code 2015-07-16 18:20:36 +02:00
Mathieu David
4d884b9c40 Added BookConfig struct, cleaned up some parts 2015-07-08 15:17:11 +02:00
Mathieu David
508f3068f0 Added arg for init to specify directory 2015-07-07 12:36:11 +02:00
Mathieu David
a6b3f99c53 Init now creates 'src' and 'book' folder. In 'src' SUMMARY.md is created with one dummy chapter 2015-07-07 11:51:06 +02:00
Mathieu David
a27bc498eb Started to implement init 2015-07-07 02:56:19 +02:00
Mathieu David
b94304405a Skeleton for main.rs (binary) 2015-07-06 21:12:24 +02:00