From bd9ba1fa6b3e78a4fc2f78bbb53a04d8ed12ca12 Mon Sep 17 00:00:00 2001 From: Arghya Ghosh <71373838+uiuxarghya@users.noreply.github.com> Date: Sun, 30 Jan 2022 15:02:48 +0530 Subject: [PATCH] format docs --- package.json | 1 + remark/prism-diff-highlight.js | 3 +- remark/utils.js | 3 +- remark/withSyntaxHighlighting.js | 4 +- src/components/Button.js | 2 +- src/components/ClassTable.js | 31 ++-- src/components/CodeSample.js | 12 +- src/components/CodeWindow.js | 32 ++-- src/components/Community.js | 14 +- src/components/GradientLockup.js | 16 +- src/components/Header.js | 28 ++-- src/components/Heading.js | 6 +- src/components/IntegrationGuides.js | 6 +- src/components/List.js | 6 +- src/components/Newsletter.js | 91 ++++++++-- src/components/PageHeader.js | 8 +- src/components/Search.js | 9 +- src/components/Testimonials.js | 33 ++-- src/components/ThemeChanger.js | 73 ++++---- src/components/Tip.js | 18 +- src/components/home/Footer.js | 64 ++++--- src/components/home/Hero.js | 22 +-- src/components/home/Menu.js | 252 +++++++++++++++------------- src/components/home/OpenSource.js | 12 +- src/components/home/common.js | 17 +- src/css/docsearch.css | 10 +- src/css/prism.css | 8 +- src/css/utilities.css | 2 +- src/layouts/BasicLayout.js | 4 +- src/layouts/ContentsLayout.js | 33 ++-- src/layouts/DocumentationLayout.js | 25 ++- src/layouts/ProgramsLayout.js | 25 ++- src/layouts/SidebarLayout.js | 27 +-- src/lib/ga/index.js | 18 +- src/navs/program.js | 9 +- src/pages/_app.js | 26 +-- src/pages/_document.js | 5 +- src/pages/brand.js | 62 ++++--- src/pages/docs/index.js | 48 +++--- src/pages/index.js | 44 ++--- src/pages/programs/index.js | 28 ++-- src/pages/sponsors.js | 68 ++++---- yarn.lock | 5 + 43 files changed, 673 insertions(+), 537 deletions(-) diff --git a/package.json b/package.json index 72744dc7..8f1ba77a 100644 --- a/package.json +++ b/package.json @@ -76,6 +76,7 @@ "eslint-plugin-flowtype": "8.0.3", "eslint-plugin-import": "2.25.3", "prettier": "^2.5.1", + "prettier-plugin-tailwindcss": "^0.1.4", "typescript": "^4.5.5", "webpack": "^5.67.0" } diff --git a/remark/prism-diff-highlight.js b/remark/prism-diff-highlight.js index 31bdf229..344a808f 100644 --- a/remark/prism-diff-highlight.js +++ b/remark/prism-diff-highlight.js @@ -1,7 +1,8 @@ // https://github.com/PrismJS/prism/blob/master/plugins/diff-highlight/prism-diff-highlight.js module.exports = (Prism) => { var LANGUAGE_REGEX = /diff-([\w-]+)/i - var HTML_TAG = /<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/gi + var HTML_TAG = + /<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/gi //this will match a line plus the line break while ignoring the line breaks HTML tags may contain. var HTML_LINE = RegExp( /(?:__|[^\r\n<])*(?:\r\n?|\n|(?:__|[^\r\n<])(?![^\r\n]))/.source.replace(/__/g, function () { diff --git a/remark/utils.js b/remark/utils.js index 5183fd96..5eff169e 100644 --- a/remark/utils.js +++ b/remark/utils.js @@ -3,7 +3,8 @@ const loadLanguages = require('prismjs/components/') loadLanguages() require('./prism-diff-highlight')(Prism) -const HTML_TAG = /<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/gi +const HTML_TAG = + /<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/gi const PSEUDO_CLASSES = [ 'active', 'any-link', diff --git a/remark/withSyntaxHighlighting.js b/remark/withSyntaxHighlighting.js index 9394e3d7..083537ac 100644 --- a/remark/withSyntaxHighlighting.js +++ b/remark/withSyntaxHighlighting.js @@ -17,7 +17,9 @@ module.exports.withSyntaxHighlighting = () => { if (node.lang !== null) { node.type = 'html' node.value = [ - `