Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migration docusaurus 2 #429

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"editor.tabSize": 2,
"editor.detectIndentation": false
}
Binary file not shown.
Binary file not shown.
Empty file.
17 changes: 17 additions & 0 deletions examples/ProguardExample/app/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>app_</name>
<comment>Project app_ created by Buildship.</comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
</natures>
</projectDescription>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
arguments=
auto.sync=false
build.scans.enabled=false
connection.gradle.distribution=GRADLE_DISTRIBUTION(VERSION(5.6.1))
connection.project.dir=
eclipse.preferences.version=1
gradle.user.home=
java.home=
jvm.arguments=
offline.mode=false
override.workspace.settings=true
show.console.view=true
show.executions.view=true
Binary file not shown.
Binary file not shown.
Empty file.
Binary file not shown.
2 changes: 2 additions & 0 deletions examples/Synth/.gradle/buildOutputCleanup/cache.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#Sat Oct 26 20:11:40 IST 2019
gradle.version=5.6.1
Empty file.
17 changes: 17 additions & 0 deletions examples/Synth/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Synth</name>
<comment>Project Synth created by Buildship.</comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
</natures>
</projectDescription>
13 changes: 13 additions & 0 deletions examples/Synth/.settings/org.eclipse.buildship.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
arguments=
auto.sync=false
build.scans.enabled=false
connection.gradle.distribution=GRADLE_DISTRIBUTION(VERSION(5.6.1))
connection.project.dir=
eclipse.preferences.version=1
gradle.user.home=
java.home=
jvm.arguments=
offline.mode=false
override.workspace.settings=true
show.console.view=true
show.executions.view=true
16 changes: 16 additions & 0 deletions website/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# dependencies
/node_modules
# production
/build
# generated files
.docusaurus
.cache-loader
# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
npm-debug.log*
yarn-debug.log*
yarn-error.log*
108 changes: 108 additions & 0 deletions website/docusaurus.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
/**

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use 2 spaces (at the most, 4) for indentation. Recommend you install the Prettier plugin for your editor.

* Copyright (c) 2017-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

// site configuration options.

const siteConfig = {
title: "Redex", // Title for your website.
tagline: "An Android Bytecode Optimizer",
url: "https://fbredex.com",
baseUrl: "/",

// Used for publishing and more
organizationName: "facebook",
projectName: "redex",

favicon: "img/favicon.png",
// You may provide arbitrary config keys to be used as needed by your
// template. For example, if you need your repo's URL...
// repoUrl: "https://github.com/facebook/redex",
presets: [
[
"@docusaurus/preset-classic",
{
docs: {
// docs folder path relative to website dir.
path: "../docs",
// sidebars file relative to website dir.
sidebarPath: require.resolve("./sidebars.json"),
// Equivalent to `enableUpdateBy`.
showLastUpdateAuthor: true,
// Equivalent to `enableUpdateTime`.
showLastUpdateTime: true
},
theme: {
customCss: require.resolve("./src/css/custom.css")
}
}
]
],
themeConfig: {
navbar: {
title: "Redex",
logo: {
alt: "Redex Logo",
src: "img/favicon.png"
},
links: [
{ to: "docs/installation", label: "Docs", position: "right" },
{ to: "docs/faq", label: "FAQ", position: "right" },
// {to: 'blog', label: 'Blog'}, // put back when we create a blog folder and add our first blog
{
href:
"https://code.facebook.com/posts/1480969635539475/optimizing-android-bytecode-with-redex",
label: "Birth",
position: "right"
}
]
},
footer: {
style: "dark",
logo: {
alt: "Facebook Open Source Logo",
src: "img/oss_logo.png"
},
links: [
{
title: "Docs",
items: [
{
label: "Getting Started",
to: "docs/installation"
},
{
label: "Configuring",
to: "docs/configuring"
},
{
label: "Using",
to: "docs/usage"
},
{
label: "FAQ",
to: "docs/faq"
}
]
},
{
title: "Social",
items: [
{
label: "Github",
href: "https://github.com/facebook/redex"
}
]
}
],
// This copyright info is used in /core/Footer.js and blog RSS/Atom feeds.
copyright: `Copyright © ${new Date().getFullYear()} Facebook Inc.`
},
image: "img/og_image.png"
}
};

module.exports = siteConfig;
18 changes: 10 additions & 8 deletions website/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
{
"scripts": {
"examples": "docusaurus-examples",
"start": "docusaurus-start",
"build": "docusaurus-build",
"publish-gh-pages": "docusaurus-publish",
"write-translations": "docusaurus-write-translations",
"version": "docusaurus-version",
"rename-version": "docusaurus-rename-version"
"start": "docusaurus start",
"build": "docusaurus build",
"swizzle": "docusaurus swizzle",
"deploy": "docusaurus deploy"

},
"devDependencies": {
"docusaurus": "^1.7.2"
"@docusaurus/core": "^2.0.0-alpha.27",
"@docusaurus/preset-classic": "^2.0.0-alpha.27",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ThakurKarthik can you please update Docusaurus to the latest version?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have updated them to newer 2.0.0-alpha.34 version

"classnames": "^2.2.6",
"react": "^16.8.4",
"react-dom": "^16.8.4"
}
}
25 changes: 25 additions & 0 deletions website/src/css/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/**
* /src/css/custom.css
* You can override the default Infima variables here.
* Note: this is not a complete list of --ifm- variables.
*/
:root {
--ifm-color-primary: #75c7a4;
--ifm-color-primary-dark: rgb(105, 173, 147);
--ifm-color-primary-darker: rgb(99, 163, 139);
--ifm-color-primary-darkest: rgb(82, 134, 115);
--ifm-color-primary-light: rgb(138, 201, 178);
--ifm-color-primary-lighter: rgb(158, 211, 191);
--ifm-color-primary-lightest: rgb(186, 224, 210);
--ifm-color-secondary: #f9f9f9;
--ifm-color-primary-dark: rgb(216, 216, 216);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please just leave what's necessary.

--ifm-color-primary-darker: rgb(204, 204, 204);
--ifm-color-primary-darkest: rgb(168, 168, 168);
--ifm-color-primary-light: rgb(242, 242, 242);
--ifm-color-primary-lighter: rgb(245, 245, 245);
--ifm-color-primary-lightest: rgb(248, 248, 248);
}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yangshun should i remove fonts from website/static/css/custom.css too?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes please

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yangshun I have removed the fonts.


body {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this whole class

font-family: "Lato", "Helvetica Neue", Arial, sans-serif;
}
66 changes: 66 additions & 0 deletions website/src/pages/faq.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
/**

This comment was marked as resolved.

* Copyright (c) 2017-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

import React from "react";
import Layout from "@theme/Layout";
import withBaseUrl from "@docusaurus/withBaseUrl";
import useDocusaurusContext from "@docusaurus/useDocusaurusContext";
import Link from "@docusaurus/Link";

function Help(props) {
const context = useDocusaurusContext();
const { siteConfig = {} } = context;
const supportLinks = [
{
content: "Ask questions about the documentation and project",
title: "Join the community"
},
{
content: "Find out what's new with this project",
title: "Stay up to date"
}
];
return (
<Layout title={siteConfig.title} description={siteConfig.description}>
<div className="docMainWrapper wrapper">
<div className="container padding-vert--lg padding-top--xl">
<div className="post">
<header className="postHeader">
<h1>Need help?</h1>
</header>
<p>This project is maintained by a dedicated group of people.</p>
</div>
<main>
{supportLinks && supportLinks.length && (
<section>
<div className="row padding-top--lg">
<div className="col col--4 text--break">
<h3>Browse Docs</h3>
<p>
Learn more using the{" "}
<Link to={withBaseUrl("docs/installation")}>
documentation on this site.
</Link>
</p>
</div>
{supportLinks.map((link, index) => (
<div key={index} className="col col--4 text--break">
<h3>{link.title}</h3>
<p>{link.content}</p>
</div>
))}
</div>
</section>
)}
</main>
</div>
</div>
</Layout>
);
}

export default Help;
Loading