From 2a168991bee2ba0a535235196986634955001368 Mon Sep 17 00:00:00 2001 From: Jules Villard Date: Tue, 16 Jun 2020 01:46:31 -0700 Subject: [PATCH] [website] include man pages in docs as pretty-ish components Summary: alicelieutier graciously contributed this React component to savagely include the HTML from the man pages into docusaurus. Now they render like the rest of the documentation! Reviewed By: cristianoc Differential Revision: D22050580 fbshipit-source-id: e8e314109 --- website/docs/man-infer-analyze.md | 8 ++++++++ website/docs/man-infer-capture.md | 8 ++++++++ website/docs/man-infer-compile.md | 8 ++++++++ website/docs/man-infer-explore.md | 8 ++++++++ website/docs/man-infer-help.md | 8 ++++++++ website/docs/man-infer-report.md | 8 ++++++++ website/docs/man-infer-reportdiff.md | 8 ++++++++ website/docs/man-infer-run.md | 8 ++++++++ website/docs/man-infer.md | 8 ++++++++ website/sidebars.js | 12 +++++++++++- website/src/components/HtmlWrap.js | 22 ++++++++++++++++++++++ 11 files changed, 105 insertions(+), 1 deletion(-) create mode 100644 website/docs/man-infer-analyze.md create mode 100644 website/docs/man-infer-capture.md create mode 100644 website/docs/man-infer-compile.md create mode 100644 website/docs/man-infer-explore.md create mode 100644 website/docs/man-infer-help.md create mode 100644 website/docs/man-infer-report.md create mode 100644 website/docs/man-infer-reportdiff.md create mode 100644 website/docs/man-infer-run.md create mode 100644 website/docs/man-infer.md create mode 100644 website/src/components/HtmlWrap.js diff --git a/website/docs/man-infer-analyze.md b/website/docs/man-infer-analyze.md new file mode 100644 index 000000000..59d2e6c37 --- /dev/null +++ b/website/docs/man-infer-analyze.md @@ -0,0 +1,8 @@ +--- +id: man-infer-analyze +title: infer analyze +--- + +import HtmlWrap from "../src/components/HtmlWrap"; + + diff --git a/website/docs/man-infer-capture.md b/website/docs/man-infer-capture.md new file mode 100644 index 000000000..54c95eb45 --- /dev/null +++ b/website/docs/man-infer-capture.md @@ -0,0 +1,8 @@ +--- +id: man-infer-capture +title: infer capture +--- + +import HtmlWrap from "../src/components/HtmlWrap"; + + diff --git a/website/docs/man-infer-compile.md b/website/docs/man-infer-compile.md new file mode 100644 index 000000000..514ae03c5 --- /dev/null +++ b/website/docs/man-infer-compile.md @@ -0,0 +1,8 @@ +--- +id: man-infer-compile +title: infer compile +--- + +import HtmlWrap from "../src/components/HtmlWrap"; + + diff --git a/website/docs/man-infer-explore.md b/website/docs/man-infer-explore.md new file mode 100644 index 000000000..fdda88ce4 --- /dev/null +++ b/website/docs/man-infer-explore.md @@ -0,0 +1,8 @@ +--- +id: man-infer-explore +title: infer explore +--- + +import HtmlWrap from "../src/components/HtmlWrap"; + + diff --git a/website/docs/man-infer-help.md b/website/docs/man-infer-help.md new file mode 100644 index 000000000..1ece39c33 --- /dev/null +++ b/website/docs/man-infer-help.md @@ -0,0 +1,8 @@ +--- +id: man-infer-help +title: infer help +--- + +import HtmlWrap from "../src/components/HtmlWrap"; + + diff --git a/website/docs/man-infer-report.md b/website/docs/man-infer-report.md new file mode 100644 index 000000000..036f26201 --- /dev/null +++ b/website/docs/man-infer-report.md @@ -0,0 +1,8 @@ +--- +id: man-infer-report +title: infer report +--- + +import HtmlWrap from "../src/components/HtmlWrap"; + + diff --git a/website/docs/man-infer-reportdiff.md b/website/docs/man-infer-reportdiff.md new file mode 100644 index 000000000..4001f990b --- /dev/null +++ b/website/docs/man-infer-reportdiff.md @@ -0,0 +1,8 @@ +--- +id: man-infer-reportdiff +title: infer reportdiff +--- + +import HtmlWrap from "../src/components/HtmlWrap"; + + diff --git a/website/docs/man-infer-run.md b/website/docs/man-infer-run.md new file mode 100644 index 000000000..561093c8c --- /dev/null +++ b/website/docs/man-infer-run.md @@ -0,0 +1,8 @@ +--- +id: man-infer-run +title: infer run +--- + +import HtmlWrap from "../src/components/HtmlWrap"; + + diff --git a/website/docs/man-infer.md b/website/docs/man-infer.md new file mode 100644 index 000000000..08f44c30e --- /dev/null +++ b/website/docs/man-infer.md @@ -0,0 +1,8 @@ +--- +id: man-infer +title: infer +--- + +import HtmlWrap from "../src/components/HtmlWrap"; + + diff --git a/website/sidebars.js b/website/sidebars.js index 59bf4c51a..d7aa24300 100644 --- a/website/sidebars.js +++ b/website/sidebars.js @@ -15,7 +15,17 @@ module.exports = { "analyzing-apps-or-projects", "steps-for-ci", "advanced-features", - "man-pages", + {"Infer Manuals": [ + "man-infer", + "man-infer-analyze", + "man-infer-capture", + "man-infer-compile", + "man-infer-explore", + "man-infer-help", + "man-infer-report", + "man-infer-reportdiff", + "man-infer-run" + ]} ], "Analyses and Issue Types": checkers.doc_entries, Foundations: [ diff --git a/website/src/components/HtmlWrap.js b/website/src/components/HtmlWrap.js new file mode 100644 index 000000000..69ecb0a5a --- /dev/null +++ b/website/src/components/HtmlWrap.js @@ -0,0 +1,22 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +import React, { useState, useEffect } from 'react'; + +export default function HtmlWrap({ url }) { + const [html, setHTML] = useState({__html: ''}); + + useEffect(() => { + fetch(url) + .then(response => response.text()) + .then(html => setHTML({__html: html})) + }, [url]); + + return ( +
+ ); +}