Преглед изворни кода

Merge remote-tracking branch 'origin/feature/#25-docs-improvements'

Andrey Konstantinov пре 3 година
родитељ
комит
0367e82ab2

+ 1 - 1
LICENSE

@@ -1,6 +1,6 @@
 MIT License
 
-Copyright (c) 2009-2019 Metrix++ Team
+Copyright (c) 2009-2020 Metrix++ Team
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal

+ 20 - 0
docs/.gitignore

@@ -0,0 +1,20 @@
+# 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*

+ 33 - 0
docs/README.md

@@ -0,0 +1,33 @@
+# Website
+
+This website is built using [Docusaurus 2](https://v2.docusaurus.io/).
+
+### Installation
+
+```
+$ yarn
+```
+
+### Local Development
+
+```
+$ yarn start
+```
+
+This command starts a local development server and open up a browser window. Most changes are reflected live without having to restart the server.
+
+### Build
+
+```
+$ yarn build
+```
+
+This command generates static content into the `build` directory and can be served using any static contents hosting service.
+
+### Deployment
+
+```
+$ GIT_USER=<Your GitHub username> USE_SSH=true yarn deploy
+```
+
+If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.

+ 3 - 0
docs/babel.config.js

@@ -0,0 +1,3 @@
+module.exports = {
+  presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
+};

+ 11 - 0
docs/blog/2019-05-28-hola.md

@@ -0,0 +1,11 @@
+---
+id: hola
+title: Hola
+author: Gao Wei
+author_title: Docusaurus Core Team
+author_url: https://github.com/wgao19
+author_image_url: https://avatars1.githubusercontent.com/u/2055384?v=4
+tags: [hola, docusaurus]
+---
+
+Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet

+ 17 - 0
docs/blog/2019-05-29-hello-world.md

@@ -0,0 +1,17 @@
+---
+id: hello-world
+title: Hello
+author: Endilie Yacop Sucipto
+author_title: Maintainer of Docusaurus
+author_url: https://github.com/endiliey
+author_image_url: https://avatars1.githubusercontent.com/u/17883920?s=460&v=4
+tags: [hello, docusaurus]
+---
+
+Welcome to this blog. This blog is created with [**Docusaurus 2 alpha**](https://v2.docusaurus.io/).
+
+<!--truncate-->
+
+This is a test post.
+
+A whole bunch of other information.

+ 13 - 0
docs/blog/2019-05-30-welcome.md

@@ -0,0 +1,13 @@
+---
+id: welcome
+title: Welcome
+author: Yangshun Tay
+author_title: Front End Engineer @ Facebook
+author_url: https://github.com/yangshun
+author_image_url: https://avatars0.githubusercontent.com/u/1315101?s=400&v=4
+tags: [facebook, hello, docusaurus]
+---
+
+Blog features are powered by the blog plugin. Simply add files to the `blog` directory. It supports tags as well!
+
+Delete the whole directory if you don't want the blog features. As simple as that!

+ 7 - 0
docs/docs/01-d-file.md

@@ -0,0 +1,7 @@
+---
+id: 01-d-file
+title: Overview
+sidebar_label: For developers
+---
+
+For developers

Разлика између датотеке није приказан због своје велике величине
+ 165 - 0
docs/docs/01-u-overview.md


+ 21 - 0
docs/docs/02-u-download-install.md

@@ -0,0 +1,21 @@
+---
+id: 02-u-download-install
+title: Download and install
+sidebar_label: Download and install
+---
+
+In order to get the tool working, [dowload the archive](https://github.com/metrixplusplus/metrixplusplus/releases) with the latest stable version and unpack it to some folder. The first run of the tool will trigger the installation within the folder, where it was launched.
+
+In order to checkout the latest development version from the [version control system](https://github.com/metrixplusplus/metrixplusplus) use this command:
+```sh
+> git clone https://github.com/metrixplusplus/metrixplusplus metrixplusplus
+```
+
+#### Change and Release Notes
+Change and release notes are available [here](https://github.com/metrixplusplus/metrixplusplus/blob/master/CHANGELOG.md).
+
+#### Prerequisites
+Python Runtime Environment (version 2.8.x or 3.x)
+
+#### License
+[MIT license](https://github.com/metrixplusplus/metrixplusplus/blob/master/LICENSE)

+ 26 - 0
docs/docs/03-u-getting-started.md

@@ -0,0 +1,26 @@
+---
+id: 03-u-getting-started
+title: Getting started
+sidebar_label: Getting started
+---
+
+The tool is relatively simple to use. There are 3 fundamental steps:
+
+* Collect the data, for example:
+```bash
+> python "/path/to/metrix++.py" collect --std.code.lines.code --std.code.complexity.cyclomatic
+```
+
+
+* View the data, for example:
+```bash
+> python "/path/to/metrix++.py" view
+```
+
+
+* Apply thresholds, for example:
+```bash
+> python "/path/to/metrix++.py" limit --max-limit=std.code.complexity:cyclomatic:7
+```
+
+Please, check the advanced [description of the workflow](04-u-workflow.md) with real examples.

Разлика између датотеке није приказан због своје велике величине
+ 506 - 0
docs/docs/04-u-workflow.md


Разлика између датотеке није приказан због своје велике величине
+ 642 - 0
docs/docs/05-u-extending-tool.md


+ 16 - 0
docs/docs/06-u-feeback-contribute.md

@@ -0,0 +1,16 @@
+---
+id: 06-u-feeback-contribute
+title: Feeback and contribute
+sidebar_label: Feeback and contribute
+---
+Now it is your turn. There are multiple ways how you can contribute and help to improve and progress Metrix++ project:
+
+* Try Metrix++ and [post review](https://github.com/metrixplusplus/metrixplusplus/issues/new)
+* [Submit new feature request or bug report](https://github.com/metrixplusplus/metrixplusplus/issues/new)
+* [Ask a question](https://github.com/metrixplusplus/metrixplusplus/issues/new)
+* Submit git pull request
+* Create and publish your plugin. [Request to refer](https://github.com/metrixplusplus/metrixplusplus/issues/new) to it from Metrix++ project space.
+* [Submit your plugin](https://github.com/metrixplusplus/metrixplusplus/issues/new) to include to the standard set
+* ... and consider to 
+<a href="mailto:avkonst@gmail.com?subject=Metrix%2B%2B Join Request" target="blank">join the project</a>
+!

+ 119 - 0
docs/docusaurus.config.js

@@ -0,0 +1,119 @@
+module.exports = {
+  title: 'Metrix++',
+  tagline: 'Management of source code quality is possible',
+  url: 'https://metrixplusplus.github.io/',
+  baseUrl: '/',
+  favicon: 'img/favicon.ico',
+  projectName: 'metrixplusplus', // Usually your repo name.
+  themeConfig: {
+    navbar: {
+      title: 'Metrix++',
+      logo: {
+        alt: 'Metrix++',
+        src: 'img/logo.svg',
+      },
+      links: [
+        {
+          to: 'docs/01-u-overview',
+          activeBasePath: 'docs',
+          label: 'Docs',
+          position: 'left',
+        },
+        {to: 'blog', label: 'Blog', position: 'left'},
+        {
+          href: 'https://github.com/metrixplusplus/metrixplusplus',
+          label: 'GitHub',
+          position: 'right',
+        },
+      ],
+    },
+    footer: {
+      style: 'dark',
+      links: [
+        {
+          title: 'Docs',
+          items: [
+            {
+              label: 'Users Manual',
+              to: 'docs/01-u-overview',
+            },
+            {
+              label: 'Developers Manual',
+              to: 'docs/01-d-file',
+            },
+          ],
+        },
+        {
+          title: 'Community',
+          items: [
+            {
+              label: 'Ask question',
+              href: 'https://github.com/metrixplusplus/metrixplusplus/issues/new',
+            },
+            {
+              label: 'Report defect',
+              href: 'https://github.com/metrixplusplus/metrixplusplus/issues/new',
+            },
+          ],
+        },
+        {
+          title: 'Extentions',
+          items: [
+            {
+              label: 'Feature request',
+              href: 'https://github.com/metrixplusplus/metrixplusplus/issues/new',
+            },
+            {
+              label: 'Open issues',
+              href: 'https://github.com/metrixplusplus/metrixplusplus/issues',
+            },
+            {
+              label: 'Changelog',
+              href: 'https://github.com/metrixplusplus/metrixplusplus/blob/master/CHANGELOG.md',
+            },
+          ],
+        },
+        {
+          title: 'More',
+          items: [
+            {
+              label: 'Blog',
+              to: 'blog',
+            },
+            {
+              label: 'GitHub',
+              href: 'https://github.com/metrixplusplus/',
+            },
+          ],
+        },
+      ],
+      copyright: `Copyright © 2009 - ${new Date().getFullYear()}, Metrix++ Project.`,
+      license: `Code licensed under MIT license, documentation under CC BY 3.0.`,
+      
+    },
+  },
+  presets: [
+    [
+      '@docusaurus/preset-classic',
+      {
+        docs: {
+          // It is recommended to set document id as docs home page (`docs/` path).
+          homePageId: 'highlights',
+          sidebarPath: require.resolve('./sidebars.js'),
+          // Please change this to your repo.
+          editUrl:
+            'https://metrixplusplus.github.io/',
+        },
+        blog: {
+          showReadingTime: true,
+          // Please change this to your repo.
+          editUrl:
+            'https://metrixplusplus.github.io/',
+        },
+        theme: {
+          customCss: require.resolve('./src/css/custom.css'),
+        },
+      },
+    ],
+  ],
+};

Разлика између датотеке није приказан због своје велике величине
+ 13177 - 0
docs/package-lock.json


+ 30 - 0
docs/package.json

@@ -0,0 +1,30 @@
+{
+  "name": "docs",
+  "version": "0.0.0",
+  "private": true,
+  "scripts": {
+    "start": "docusaurus start",
+    "build": "docusaurus build",
+    "swizzle": "docusaurus swizzle",
+    "deploy": "docusaurus deploy"
+  },
+  "dependencies": {
+    "@docusaurus/core": "^2.0.0-alpha.58",
+    "@docusaurus/preset-classic": "^2.0.0-alpha.58",
+    "clsx": "^1.1.1",
+    "react": "^16.8.4",
+    "react-dom": "^16.8.4"
+  },
+  "browserslist": {
+    "production": [
+      ">0.2%",
+      "not dead",
+      "not op_mini all"
+    ],
+    "development": [
+      "last 1 chrome version",
+      "last 1 firefox version",
+      "last 1 safari version"
+    ]
+  }
+}

+ 15 - 0
docs/sidebars.js

@@ -0,0 +1,15 @@
+module.exports = {
+  someSidebar: {
+    'Users Manual': [
+        '01-u-overview',
+        '02-u-download-install',
+        '03-u-getting-started',
+        '04-u-workflow',
+        '05-u-extending-tool',
+        '06-u-feeback-contribute'
+    ],
+    'Developers Manual': [
+        '01-d-file'
+    ],
+  },
+};

+ 35 - 0
docs/src/css/custom.css

@@ -0,0 +1,35 @@
+/* stylelint-disable docusaurus/copyright-header */
+/**
+ * Any CSS included here will be global. The classic template
+ * bundles Infima by default. Infima is a CSS framework designed to
+ * work well for content-centric websites.
+ */
+
+/* You can override the default Infima variables here. */
+:root {
+  --ifm-color-primary: #25c2a0;
+  --ifm-color-primary-dark: rgb(33, 175, 144);
+  --ifm-color-primary-darker: rgb(31, 165, 136);
+  --ifm-color-primary-darkest: rgb(26, 136, 112);
+  --ifm-color-primary-light: rgb(70, 203, 174);
+  --ifm-color-primary-lighter: rgb(102, 212, 189);
+  --ifm-color-primary-lightest: rgb(146, 224, 208);
+  --ifm-code-font-size: 95%;
+}
+
+.docusaurus-highlight-code-line {
+  background-color: rgb(72, 77, 91);
+  display: block;
+  margin: 0 calc(-1 * var(--ifm-pre-padding));
+  padding: 0 var(--ifm-pre-padding);
+}
+
+.info{
+  background-color: #d9edf7;
+}
+.td-regular{
+  background-color: #FFFFFF !important;
+}
+.center-justified {
+  text-align: justify;
+}

BIN
docs/src/img/piechart.png


+ 127 - 0
docs/src/pages/index.js

@@ -0,0 +1,127 @@
+import React from 'react';
+import clsx from 'clsx';
+import Layout from '@theme/Layout';
+import Link from '@docusaurus/Link';
+import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
+import useBaseUrl from '@docusaurus/useBaseUrl';
+import styles from './styles.module.css';
+
+const features = [
+  {
+    title: <>Configurable</>,
+    imageUrl: 'img/undraw_docusaurus_mountain.svg',
+    description: (
+      <>
+        Define and apply your rules and policies.
+        Integrate with your workflow.
+      </>
+    ),
+  },
+  {
+    title: <>Extendable via plugins</>,
+    imageUrl: 'img/undraw_docusaurus_mountain.svg',
+    description: (
+      <>
+        Define your custom metric.
+        Add new language parser.
+        Create advanced post-analysis tool.
+      </>
+    ),
+  },
+  {
+    title: <>Multiple metrics</>,
+    imageUrl: 'img/undraw_docusaurus_react.svg',
+    description: (
+      <>
+        Complexity, size and other.
+      </>
+    ),
+  },
+  {
+    title: <>Multiple languages</>,
+    imageUrl: 'img/undraw_docusaurus_tree.svg',
+    description: (
+      <>
+        C/C++, C# and Java.
+        Recognises classes, interfaces, namespaces, functions, comments, preprocessor and much more.
+      </>
+    ),
+  },
+  {
+    title: <>High performance and scalability</>,
+    imageUrl: 'img/undraw_docusaurus_react.svg',
+    description: (
+      <>
+        Applicable to huge code bases: thousands of files per minute.
+        Ultra-fast feedback on iterative re-run.
+      </>
+    ),
+  },
+  {
+    title: <>Effortless application to legacy code</>,
+    imageUrl: 'img/undraw_docusaurus_react.svg',
+    description: (
+      <>
+        Recognises legacy, modified and new code.
+        Prevents from negative trends. Encourages positive.
+      </>
+    ),
+  },
+];
+
+function Feature({imageUrl, title, description}) {
+  const imgUrl = useBaseUrl(imageUrl);
+  return (
+    <div className={clsx('col col--4', styles.feature)}>
+      {imgUrl && (
+        <div className="text--center">
+          <img className={styles.featureImage} src={imgUrl} alt={title} />
+        </div>
+      )}
+      <h3>{title}</h3>
+      <p>{description}</p>
+    </div>
+  );
+}
+
+function Home() {
+  const context = useDocusaurusContext();
+  const {siteConfig = {}} = context;
+  return (
+    <Layout
+      title={`${siteConfig.title}`}
+      description="Description will go into a meta tag in <head />">
+      <header className={clsx('hero hero--primary', styles.heroBanner)}>
+        <div className="container">
+          <h1 className="hero__title">{siteConfig.title}</h1>
+          <p className="hero__subtitle">{siteConfig.tagline}</p>
+          <div className={styles.buttons}>
+            <Link
+              className={clsx(
+                'button button--outline button--secondary button--lg',
+                styles.getStarted,
+              )}
+              to={useBaseUrl('docs/01-u-overview')}>
+              Get Started
+            </Link>
+          </div>
+        </div>
+      </header>
+      <main>
+        {features && features.length > 0 && (
+          <section className={styles.features}>
+            <div className="container">
+              <div className="row">
+                {features.map((props, idx) => (
+                  <Feature key={idx} {...props} />
+                ))}
+              </div>
+            </div>
+          </section>
+        )}
+      </main>
+    </Layout>
+  );
+}
+
+export default Home;

+ 37 - 0
docs/src/pages/styles.module.css

@@ -0,0 +1,37 @@
+/* stylelint-disable docusaurus/copyright-header */
+
+/**
+ * CSS files with the .module.css suffix will be treated as CSS modules
+ * and scoped locally.
+ */
+
+.heroBanner {
+  padding: 4rem 0;
+  text-align: center;
+  position: relative;
+  overflow: hidden;
+}
+
+@media screen and (max-width: 966px) {
+  .heroBanner {
+    padding: 2rem;
+  }
+}
+
+.buttons {
+  display: flex;
+  align-items: center;
+  justify-content: center;
+}
+
+.features {
+  display: flex;
+  align-items: center;
+  padding: 2rem 0;
+  width: 100%;
+}
+
+.featureImage {
+  height: 200px;
+  width: 200px;
+}

+ 0 - 0
docs/static/.nojekyll


BIN
docs/static/img/favicon.ico


Разлика између датотеке није приказан због своје велике величине
+ 1 - 0
docs/static/img/logo.svg


Разлика између датотеке није приказан због своје велике величине
+ 170 - 0
docs/static/img/undraw_docusaurus_mountain.svg


Разлика између датотеке није приказан због своје велике величине
+ 169 - 0
docs/static/img/undraw_docusaurus_react.svg


Разлика између датотеке није приказан због своје велике величине
+ 1 - 0
docs/static/img/undraw_docusaurus_tree.svg


+ 1 - 1
metrix++.py

@@ -1,5 +1,5 @@
 #
-#    Metrix++, Copyright 2009-2019, Metrix++ Project
+#    Metrix++, Copyright 2009-2020, Metrix++ Project
 #    Link: https://github.com/metrixplusplus/metrixplusplus
 #    
 #    This file is a part of Metrix++ Tool.