added all files to project

This commit is contained in:
2022-03-10 10:36:59 +01:00
parent 09dd957b33
commit 46a936d7de
25351 changed files with 3883356 additions and 0 deletions
+13
View File
@@ -0,0 +1,13 @@
# Changelog
## 0.36.2
- Fixed: outdated remark dependencies
## 0.36.1
- Fixed: outdated dependencies
## Previous changes
See [postcss-markdown releases](https://github.com/gucong3000/postcss-markdown).
+21
View File
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2018 刘祺
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
+92
View File
@@ -0,0 +1,92 @@
# PostCSS Markdown Syntax
[![NPM version](https://img.shields.io/npm/v/@stylelint/postcss-markdown.svg)](https://www.npmjs.org/package/@stylelint/postcss-markdown) [![Build Status](https://github.com/stylelint/postcss-markdown/workflows/CI/badge.svg)](https://github.com/stylelint/postcss-markdown/actions)
<img align="right" width="95" height="95"
title="Philosopher’s stone, logo of PostCSS"
src="http://postcss.github.io/postcss/logo.svg">
[PostCSS](https://github.com/postcss/postcss) Syntax for parsing [Markdown](https://daringfireball.net/projects/markdown/syntax)
## Getting Started
First thing's first, install the module:
```
npm install postcss-syntax postcss-markdown --save-dev
```
If you want support SCSS/SASS/LESS/SugarSS syntax, you need to install the corresponding module.
- SCSS: [postcss-scss](https://github.com/postcss/postcss-scss)
- SASS: [postcss-sass](https://github.com/aleshaoleg/postcss-sass)
- LESS: [postcss-less](https://github.com/shellscape/postcss-less)
- SugarSS: [sugarss](https://github.com/postcss/sugarss)
## Use Cases
```js
var syntax = require("postcss-syntax")({
// Enable support for HTML (default: true) See: https://github.com/gucong3000/postcss-html
htmlInMd: true,
// syntax for parse scss (non-required options)
scss: require("postcss-scss"),
// syntax for parse less (non-required options)
less: require("postcss-less"),
// syntax for parse css blocks (non-required options)
css: require("postcss-safe-parser")
});
var autoprefixer = require("autoprefixer");
postcss([autoprefixer])
.process(source, { syntax: syntax })
.then(function(result) {
// An alias for the result.css property. Use it with syntaxes that generate non-CSS output.
result.content;
});
```
input:
<pre><code># title
```css
::placeholder {
color: gray;
}
```
</code></pre>
output:
<pre><code># title
```css
::-webkit-input-placeholder {
color: gray;
}
:-ms-input-placeholder {
color: gray;
}
::-ms-input-placeholder {
color: gray;
}
::placeholder {
color: gray;
}
```
</code></pre>
If you want support SCSS/SASS/LESS/SugarSS syntax, you need to install these module:
- SCSS: [postcss-scss](https://github.com/postcss/postcss-scss)
- SASS: [postcss-sass](https://github.com/aleshaoleg/postcss-sass)
- LESS: [postcss-less](https://github.com/shellscape/postcss-less)
- SugarSS: [sugarss](https://github.com/postcss/sugarss)
## Advanced Use Cases
See: [postcss-syntax](https://github.com/gucong3000/postcss-syntax)
## Style Transformations
The main use case of this plugin is apply PostCSS transformations to CSS (and CSS-like) code blocks in markdown file.
+42
View File
@@ -0,0 +1,42 @@
"use strict";
const remark = require("remark");
const findAllAfter = require("unist-util-find-all-after");
function mdParser (source, opts, result) {
const htmlInMd = opts.syntax.config.htmlInMd;
if (!result && (htmlInMd == null || htmlInMd)) {
result = require("postcss-html/extract")(source, opts, []);
}
const ast = remark().parse(source);
const blocks = findAllAfter(ast, 0, (node) => (
node.type === "code"
)).map((block) => {
if (result && (!block.lang || !/^(?:[sx]?html?|[sx]ht)$/i.test(block.lang))) {
result = result.filter(styleHtm => {
return styleHtm.startIndex >= block.position.end.offset ||
styleHtm.startIndex + styleHtm.content.length <= block.position.start.offset;
});
}
if (block.lang && /^(?:(?:\w*c)|le|wx|sa?|sugar)ss$/i.test(block.lang)) {
let startIndex = source.indexOf(block.lang, block.position.start.offset) + block.lang.length;
if (block.value) {
startIndex = source.indexOf(block.value, startIndex);
} else {
startIndex = source.indexOf("\n", startIndex) + 1;
}
return {
startIndex: startIndex,
lang: block.lang.toLowerCase(),
isMarkdown: true,
content: source.slice(startIndex, block.position.end.offset).replace(/[ \t]*`*$/, ""),
};
}
}).filter(Boolean);
if (result) {
return result.concat(blocks);
} else {
return blocks;
}
};
module.exports = mdParser;
+5
View File
@@ -0,0 +1,5 @@
"use strict";
const extract = require("./extract");
const syntax = require("postcss-syntax/syntax")(extract, "markdown");
module.exports = syntax;
+102
View File
@@ -0,0 +1,102 @@
{
"_args": [
[
"@stylelint/postcss-markdown@0.36.2",
"/home/pi/Desktop/smartMirrorTestEnvironment/MagicMirror"
]
],
"_development": true,
"_from": "@stylelint/postcss-markdown@0.36.2",
"_id": "@stylelint/postcss-markdown@0.36.2",
"_inBundle": false,
"_integrity": "sha512-2kGbqUVJUGE8dM+bMzXG/PYUWKkjLIkRLWNh39OaADkiabDRdw8ATFCgbMz5xdIcvwspPAluSL7uY+ZiTWdWmQ==",
"_location": "/@stylelint/postcss-markdown",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "@stylelint/postcss-markdown@0.36.2",
"name": "@stylelint/postcss-markdown",
"escapedName": "@stylelint%2fpostcss-markdown",
"scope": "@stylelint",
"rawSpec": "0.36.2",
"saveSpec": null,
"fetchSpec": "0.36.2"
},
"_requiredBy": [
"/stylelint"
],
"_resolved": "https://registry.npmjs.org/@stylelint/postcss-markdown/-/postcss-markdown-0.36.2.tgz",
"_spec": "0.36.2",
"_where": "/home/pi/Desktop/smartMirrorTestEnvironment/MagicMirror",
"author": {
"name": "gucong"
},
"bugs": {
"url": "https://github.com/stylelint/postcss-markdown/issues"
},
"dependencies": {
"remark": "^13.0.0",
"unist-util-find-all-after": "^3.0.2"
},
"description": "PostCSS syntax for parsing Markdown",
"devDependencies": {
"chai": "^4.2.0",
"codecov": "^3.8.1",
"mocha": "^8.2.1",
"np": "^7.0.0",
"nyc": "^15.1.0",
"postcss": ">=7.0.27",
"postcss-html": ">=0.36.0",
"postcss-less": "^3.1.4",
"postcss-scss": "^2.0.0",
"postcss-syntax": ">=0.36.2",
"sugarss": "^2.0.0"
},
"files": [
"*.js"
],
"homepage": "https://github.com/stylelint/postcss-markdown#readme",
"keywords": [
"postcss",
"syntax",
"markdown",
"html",
"css",
"less",
"sass",
"scss",
"sss",
"sugarss"
],
"license": "MIT",
"main": "index.js",
"name": "@stylelint/postcss-markdown",
"nyc": {
"reporter": [
"lcov",
"text"
],
"all": true,
"cache": true,
"check-coverage": true
},
"peerDependencies": {
"postcss": ">=7.0.0",
"postcss-syntax": ">=0.36.2"
},
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "git+https://github.com/stylelint/postcss-markdown.git"
},
"scripts": {
"debug": "npm run mocha -- --inspect-brk",
"mocha": "mocha --no-timeouts",
"release": "np",
"test": "nyc npm run mocha"
},
"version": "0.36.2"
}