diff --git a/docs/06-about.md b/docs/about.md similarity index 80% rename from docs/06-about.md rename to docs/about.md index 3c1f94c..858d860 100644 --- a/docs/06-about.md +++ b/docs/about.md @@ -2,6 +2,8 @@ This work is a design proposal for an httpx 1.0 release. +--- + ## Sponsorship We are currently seeking forward-looking investment that recognises the value of the infrastructure development on it's own merit. Sponsorships may be [made through GitHub](https://github.com/encode). @@ -11,3 +13,8 @@ We do not offer equity, placements, or endorsments. ## License The rights of the author have been asserted. + +--- + +← [Networking](networking.md) +  diff --git a/docs/01-clients.md b/docs/clients.md similarity index 97% rename from docs/01-clients.md rename to docs/clients.md index 552fa87..23f6f00 100644 --- a/docs/01-clients.md +++ b/docs/clients.md @@ -177,6 +177,6 @@ You can expand on this pattern to provide behavior such as request or response s --- -← [Quickstart](00-quickstart.md) -[HTTP Components](02-components.md) → +← [Quickstart](quickstart.md) +[HTTP Components](components.md) →   diff --git a/docs/02-components.md b/docs/components.md similarity index 98% rename from docs/02-components.md rename to docs/components.md index 813ebb3..0d0854c 100644 --- a/docs/02-components.md +++ b/docs/components.md @@ -215,6 +215,6 @@ The following methods can be used to create modified header instances... --- -← [Clients](01-clients.md) -[HTTP Content](03-content.md) → +← [Clients](clients.md) +[HTTP Content](content.md) →   diff --git a/docs/04-connections.md b/docs/connections.md similarity index 96% rename from docs/04-connections.md rename to docs/connections.md index dd28d81..bf8a6d6 100644 --- a/docs/04-connections.md +++ b/docs/connections.md @@ -138,6 +138,6 @@ with httpx.open_connection("http://127.0.0.1:8080") as conn: --- -← [HTTP Content](03-content.md) -[Low Level Networking](05-networking.md) → +← [HTTP Content](content.md) +[Low Level Networking](networking.md) →   diff --git a/docs/03-content.md b/docs/content.md similarity index 97% rename from docs/03-content.md rename to docs/content.md index 163dfcf..6026b89 100644 --- a/docs/03-content.md +++ b/docs/content.md @@ -152,6 +152,6 @@ Implmentations should typically set a `Content-Type` header indicating the corre --- -← [HTTP Components](02-components.md) -[Connections](04-connections.md) → +← [HTTP Components](components.md) +[Connections](connections.md) →   diff --git a/docs/README.md b/docs/index.md similarity index 93% rename from docs/README.md rename to docs/index.md index 8d6e78c..fc9df17 100644 --- a/docs/README.md +++ b/docs/index.md @@ -8,6 +8,8 @@ *The following is a design proposal and is not yet fully functional. The work is well underway, tho be aware that some parts of the codebase are still under development.* +--- + # Background One of the core design principles informing `httpx` has been to aim to reduce the complexity of the stack. @@ -56,16 +58,19 @@ Lets get to work... '\n\n\nExample Domain...' ``` +--- + # Documentation The httpx 1.0 [design proposal](https://staging.d2pg1230p7w6nv.amplifyapp.com/) is now available. -* [Quickstart](docs/00-quickstart.md) -* [Clients](docs/01-clients.md) -* [HTTP Components](docs/02-components.md) -* [HTTP Content](docs/03-content.md) -* [Connections](docs/04-connections.md) -* [Low Level Networking](docs/05-networking.md) +* [Quickstart](quickstart.md) +* [Clients](clients.md) +* [HTTP Components](components.md) +* [HTTP Content](content.md) +* [Connections](connections.md) +* [Low Level Networking](networking.md) +* [About](about.md) *Documentation & design work on `httpx` for server-side usage is in progress.* diff --git a/docs/05-networking.md b/docs/networking.md similarity index 98% rename from docs/05-networking.md rename to docs/networking.md index ef9391f..f7665c9 100644 --- a/docs/05-networking.md +++ b/docs/networking.md @@ -230,5 +230,6 @@ Custom network backends can also be used to provide functionality such as handli --- -← [Connections](04-connections.md) +← [Connections](connections.md) +[About](about.md) →   diff --git a/docs/00-quickstart.md b/docs/quickstart.md similarity index 98% rename from docs/00-quickstart.md rename to docs/quickstart.md index 452ff33..8298d74 100644 --- a/docs/00-quickstart.md +++ b/docs/quickstart.md @@ -266,5 +266,6 @@ You can stream the binary content of the response... --- -[Clients](01-clients.md) → +← [Home](index.md) +[Clients](clients.md) →   \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml new file mode 100644 index 0000000..1630d58 --- /dev/null +++ b/mkdocs.yml @@ -0,0 +1,14 @@ +site_name: My Docs + +theme: + name: null + custom_dir: 'theme/' + +nav: + - Home: index.md + - QuickStart: quickstart.md + - Clients: clients.md + - Components: components.md + - Content: content.md + - Networking: networking.md + - About: about.md diff --git a/scripts/mkdocs b/scripts/mkdocs deleted file mode 100755 index 34dd4e1..0000000 --- a/scripts/mkdocs +++ /dev/null @@ -1,69 +0,0 @@ -#!venv/bin/python -import pathlib -import markdown -import jinja2 -import xml.etree.ElementTree as etree - -source_dir = pathlib.Path('docs') -target_dir = pathlib.Path('html') - -loader = jinja2.FileSystemLoader('docs/templates') -env = jinja2.Environment(loader=loader) -template = env.get_template('base.html') - - -class URLsProcessor(markdown.treeprocessors.Treeprocessor): - def run(self, root: etree.Element) -> etree.Element: - for element in root.iter(): - if element.tag == 'a': - key = 'href' - elif element.tag == 'img': - key = 'src' - else: - continue - - href = element.get(key) - if href is not None: - output_url = self.rewrite_url(href) - element.set(key, output_url) - - return root - - def rewrite_url(self, href: str) -> str: - source = pathlib.Path(href) - return f"{source.stem}.html" - - # if url_or_path.startswith('http://') or url_or_path.startswith('https://'): - # return url_or_path - - # current_page = self._state.current_page - # current_directory = os.path.dirname(current_page.source_path) - - # referenced_path = os.path.normpath(os.path.join(current_directory, url_or_path)) - # referenced_page = self._site.pages.lookup(source_path=referenced_path) - # if referenced_page is None: - # return "#" - # return referenced_page.url - - -md = markdown.Markdown(extensions=['fenced_code']) -md.treeprocessors.register( - item=URLsProcessor(), - name='urls', - priority=10, -) - - -for file in source_dir.iterdir(): - if file.is_file() and file.suffix == ".md": - name = "index" if file.stem == "README" else file.stem - target = target_dir / f"{name}.html" - - with open(file, 'r', encoding='utf-8') as fin: - text = fin.read() - - content = md.convert(text) - output = template.render(content=content) - - with open(target, 'w', encoding='utf-8') as fout: - fout.write(output) diff --git a/docs/templates/base.html b/theme/main.html similarity index 99% rename from docs/templates/base.html rename to theme/main.html index 6e42083..12b3745 100644 --- a/docs/templates/base.html +++ b/theme/main.html @@ -108,7 +108,7 @@
- {{ content }} + {{ page.content }}
\ No newline at end of file