resolve: 'gatsby-plugin-typography',
options: { pathToConfigModule: `src/utils/typography` }
},
- 'gatsby-transformer-remark',
+ {
+ resolve: 'gatsby-transformer-remark',
+ options: {
+ plugins: [
+ {
+ resolve: 'gatsby-remark-custom-blocks',
+ options: {
+ blocks: {
+ danger: 'alert alert-danger',
+ warning: 'alert alert-warning',
+ info: 'alert alert-info',
+ success: 'alert alert-success'
+ }
+ }
+ }
+ ]
+ }
+ },
'gatsby-plugin-glamor'
]
};
"gatsby-plugin-glamor": "^1.6.13",
"gatsby-plugin-react-helmet": "^2.0.10",
"gatsby-plugin-typography": "^1.7.18",
+ "gatsby-remark-custom-blocks": "^1.0.5",
"gatsby-source-filesystem": "^1.5.34",
"gatsby-transformer-remark": "^1.7.40",
"react-helmet": "^5.2.0",
A project must belong to an [organization](/organizations/index). Create one if you intend to collaborate with your team mates, or use your personal organization for test purposes.
-** /!\ Important note for private code:** Newly created organizations and personal organizations are under a free plan by default. This means projects analyzed on these organizations are public by default: the code will be browsable by anyone. If you want private projects, you should [upgrade your organization to a paid plan](/sonarcloud-pricing) in the "Administration > Billing" page of your organization.
+[[info]]
+| ** Important note for private code:** Newly created organizations and personal organizations are under a free plan by default. This means projects analyzed on these organizations are public by default: the code will be browsable by anyone. If you want private projects, you should [upgrade your organization to a paid plan](/sonarcloud-pricing) in the "Administration > Billing" page of your organization.
Find the key of your organization, you will need it at later stages. It can be found on the top right corner of your organization's header.
You can connect to SonarCloud using your VSTS account. On the [login page](/#sonarcloud#/sessions/new), just click on the "Log in with VSTS" button.
-** /!\ Warning:** Only work and school VSTS accounts are authorized to login on SonarCloud.
+[[warning]]
+| Only work and school VSTS accounts are authorized to login on SonarCloud.
## Install the SonarCloud VSTS extension
* **For public projects:** you can simply select your project from the dropdown. A searchbar inside the dropdown will help you find it easily. Just select it and click on the "Save" button.
- * **For private projects:** you'll have to log in using the links provided under the dropdown. Once logged in, your private projects will appear in the dropdown. Select the one you are interested in, and click on "Save".
\ No newline at end of file
+ * **For private projects:** you'll have to log in using the links provided under the dropdown. Once logged in, your private projects will appear in the dropdown. Select the one you are interested in, and click on "Save".
--- /dev/null
+.alert {
+ display: block;
+ margin: 0 -1em 1.5rem;
+ padding: 1em;
+ border: 1px solid #777;
+}
+
+.alert > p {
+ margin: 0;
+}
+
+.alert-danger {
+ border-color: #ebccd1;
+ background-color: #f2dede;
+ color: #a94442;
+}
+
+.alert-warning {
+ border-color: #faebcc;
+ background-color: #fcf8e3;
+ color: #8a6d3b;
+}
+
+.alert-info {
+ border-color: #bce8f1;
+ background-color: #d9edf7;
+ color: #31708f;
+}
+
+.alert-success {
+ border-color: #d6e9c6;
+ background-color: #dff0d8;
+ color: #3c763d;
+}
*/
import React from 'react';
import Helmet from 'react-helmet';
+import './page.css';
export default ({ data }) => {
const page = data.markdownRemark;
scroll-behavior "^0.9.9"
warning "^3.0.0"
+gatsby-remark-custom-blocks@^1.0.5:
+ version "1.0.5"
+ resolved "https://registry.yarnpkg.com/gatsby-remark-custom-blocks/-/gatsby-remark-custom-blocks-1.0.5.tgz#c5601c4be4d4e325bd41d656cf7b18670070435b"
+ dependencies:
+ babel-runtime "^6.26.0"
+ remark-custom-blocks "^1.0.6"
+
gatsby-source-filesystem@^1.5.34:
version "1.5.34"
resolved "https://registry.yarnpkg.com/gatsby-source-filesystem/-/gatsby-source-filesystem-1.5.34.tgz#cfac995cd8f2d5f406ad073a213ca7566de17f44"
fbjs "^0.8.14"
relay-debugger-react-native-runtime "0.0.10"
+remark-custom-blocks@^1.0.6:
+ version "1.0.9"
+ resolved "https://registry.yarnpkg.com/remark-custom-blocks/-/remark-custom-blocks-1.0.9.tgz#40f9511097104d074e814f3487e24411425a03e6"
+ dependencies:
+ space-separated-tokens "^1.1.1"
+
remark-include@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/remark-include/-/remark-include-2.0.0.tgz#f5934f0093316482cdb8dae7a72d0a1ae07bf9db"
dependencies:
source-map "0.5.6"
-space-separated-tokens@^1.0.0:
+space-separated-tokens@^1.0.0, space-separated-tokens@^1.1.1:
version "1.1.2"
resolved "https://registry.yarnpkg.com/space-separated-tokens/-/space-separated-tokens-1.1.2.tgz#e95ab9d19ae841e200808cd96bc7bd0adbbb3412"
dependencies:
"redux": "3.7.2",
"redux-logger": "3.0.6",
"redux-thunk": "2.2.0",
+ "remark-custom-blocks": "2.2.0",
"remark-toc": "5.0.0",
"whatwg-fetch": "2.0.4"
},
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2018 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+declare module 'remark-custom-blocks' {
+ export default function customBlock(): any;
+}
background-color: rgba(0, 0, 0, 0.06);
}
+.documentation-content.markdown .alert,
.documentation-content.markdown p,
.documentation-content.markdown pre,
.documentation-content.markdown table {
.documentation-content.markdown img[src$='.svg'] {
vertical-align: text-bottom;
}
+
+.documentation-content.markdown .alert p {
+ margin: 0;
+}
import remark from 'remark';
import reactRenderer from 'remark-react';
import remarkToc from 'remark-toc';
+import remarkCustomBlocks from 'remark-custom-blocks';
import DocLink from './DocLink';
import DocImg from './DocImg';
import DocTooltipLink from './DocTooltipLink';
{
remark()
.use(remarkToc, { maxDepth: 3 })
+ .use(remarkCustomBlocks, {
+ danger: { classes: 'alert alert-danger' },
+ warning: { classes: 'alert alert-warning' },
+ info: { classes: 'alert alert-info' },
+ success: { classes: 'alert alert-success' }
+ })
.use(reactRenderer, {
remarkReactComponents: {
- // do not render outer <div />
- div: React.Fragment,
+ div: Block,
// use custom link to render documentation anchors
a: isTooltip
? withChildProps(DocTooltipLink, childProps)
// use custom img tag to render documentation images
img: DocImg
},
- toHast: {}
+ toHast: {},
+ sanitize: false
})
.processSync(filterContent(parsed.content)).contents
}
return <WrappedComponent customProps={childProps} {...props} />;
};
}
+
+function Block(props: React.HtmlHTMLAttributes<HTMLDivElement>) {
+ if (props.className) {
+ return <div className={classNames('cut-margins', props.className)}>{props.children}</div>;
+ } else {
+ return props.children;
+ }
+}
<div
className="markdown"
>
- <React.Fragment
+ <Block
key="h-1"
>
<p
>
text
</p>
- </React.Fragment>
+ </Block>
</div>
`;
<div
className="markdown"
>
- <React.Fragment
+ <Block
key="h-1"
>
<p
>
text
</p>
- </React.Fragment>
+ </Block>
</div>
`;
<div
className="markdown"
>
- <React.Fragment
+ <Block
key="h-1"
>
<p
</em>
text
</p>
- </React.Fragment>
+ </Block>
</div>
`;
-exports[`should use custom component for links 1`] = `
+exports[`should render with custom props for links 1`] = `
<withChildProps
- href="/quality-profiles"
+ href="#quality-profiles"
key="h-3"
>
link
</withChildProps>
`;
-exports[`should render with custom props for links 1`] = `
+exports[`should use custom component for links 1`] = `
<withChildProps
- href="#quality-profiles"
+ href="/quality-profiles"
key="h-3"
>
link
version "0.2.7"
resolved "https://registry.yarnpkg.com/relateurl/-/relateurl-0.2.7.tgz#54dbf377e51440aca90a4cd274600d3ff2d888a9"
+remark-custom-blocks@2.2.0:
+ version "2.2.0"
+ resolved "https://registry.yarnpkg.com/remark-custom-blocks/-/remark-custom-blocks-2.2.0.tgz#44a809818537482d3a89a4bcb41c978867653836"
+ dependencies:
+ space-separated-tokens "^1.1.1"
+
remark-parse@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/remark-parse/-/remark-parse-5.0.0.tgz#4c077f9e499044d1d5c13f80d7a98cf7b9285d95"
version "0.6.1"
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263"
-space-separated-tokens@^1.0.0:
+space-separated-tokens@^1.0.0, space-separated-tokens@^1.1.1:
version "1.1.2"
resolved "https://registry.yarnpkg.com/space-separated-tokens/-/space-separated-tokens-1.1.2.tgz#e95ab9d19ae841e200808cd96bc7bd0adbbb3412"
dependencies: