Revert "Add docs_preprocessor
crate to support Zed Docs" (#16880)
Temporarily revert #16700 to deal with this error: `error: manifest path `../crates/docs_preprocessor/Cargo.toml` does not exist` as it was causing the docs-preprocessor not to run, meaning unexpanded templates were showing up in the public docs. Reverts zed-industries/zed#16700 Release Notes: - N/A
This commit is contained in:
parent
c658ad8380
commit
2a03dde538
16 changed files with 24 additions and 639 deletions
|
@ -1,25 +0,0 @@
|
|||
use crate::PreprocessorContext;
|
||||
use regex::Regex;
|
||||
use std::collections::HashMap;
|
||||
|
||||
mod action;
|
||||
mod keybinding;
|
||||
|
||||
pub use action::*;
|
||||
pub use keybinding::*;
|
||||
|
||||
pub trait Template {
|
||||
fn key(&self) -> &'static str;
|
||||
fn regex(&self) -> Regex;
|
||||
fn parse_args(&self, args: &str) -> HashMap<String, String>;
|
||||
fn render(&self, context: &PreprocessorContext, args: &HashMap<String, String>) -> String;
|
||||
|
||||
fn process(&self, context: &PreprocessorContext, content: &str) -> String {
|
||||
self.regex()
|
||||
.replace_all(content, |caps: ®ex::Captures| {
|
||||
let args = self.parse_args(&caps[1]);
|
||||
self.render(context, &args)
|
||||
})
|
||||
.into_owned()
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue