Auto-Generate Documentation for nushell.com (#2139)

* Very rough idea

* Remove colour codes

* Work on command for generating docs

* Quick comment

* Use nested collapsible markdown

* Refine documentation command

* Clippy and rename docs

* This layout probably seems best

Also moved some code to documentation.rs to avoid making help.rs massive

* Delete summaries.md

* Add usage strings

* Remove static annotations

* get_documentation produces value

Which will be used like
'help generate_docs | save "something"'
The resulting yaml can be passed to a script for generating HTML/MD files in the website

* Fix subcommands

* DRY code

* Address clippy:

* Fix links

* Clippy lints

* Move documentation to more central location
This commit is contained in:
Arash Outadi
2020-07-17 15:22:43 -07:00
committed by GitHub
parent 7b02604e6d
commit b358804904
7 changed files with 306 additions and 171 deletions

View File

@ -243,12 +243,10 @@ pub fn view_contents(
image::FilterType::Lanczos3,
);
let mut count = 0;
for pixel in resized_img.pixels() {
for (count, pixel) in resized_img.pixels().enumerate() {
use image::Pixel;
let rgb = pixel.to_rgb();
render_context.frame_buffer[count] = (rgb[0], rgb[1], rgb[2]);
count += 1;
}
}
image::ColorType::RGB(8) => {
@ -266,12 +264,10 @@ pub fn view_contents(
image::FilterType::Lanczos3,
);
let mut count = 0;
for pixel in resized_img.pixels() {
for (count, pixel) in resized_img.pixels().enumerate() {
use image::Pixel;
let rgb = pixel.to_rgb();
render_context.frame_buffer[count] = (rgb[0], rgb[1], rgb[2]);
count += 1;
}
}
_ => {
@ -351,13 +347,11 @@ pub fn view_contents_interactive(
render_context.clear();
let mut count = 0;
for pixel in resized_img.pixels() {
for (count, pixel) in resized_img.pixels().enumerate() {
use image::Pixel;
let rgb = pixel.to_rgb();
render_context.frame_buffer[count] = (rgb[0], rgb[1], rgb[2]);
count += 1;
}
render_context.flush()?;