mirror of
https://github.com/iconify/iconify.git
synced 2024-11-13 00:06:29 +00:00
Automatically update version in readme
This commit is contained in:
parent
ff7552abda
commit
eb758c4fde
@ -18,7 +18,7 @@ Iconify uses a new innovative approach to loading icons. Unlike fonts and SVG fr
|
|||||||
|
|
||||||
Iconify SVG framework is designed to be as easy to use as possible.
|
Iconify SVG framework is designed to be as easy to use as possible.
|
||||||
|
|
||||||
Add this line to your page to load Iconify SVG framework (you can add it to `<head>` section of page or before `</body>`):
|
Add this line to your page to load Iconify SVG framework (you can add it to `<head>` section of the page or before `</body>`):
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<script src="https://code.iconify.design/2/2.0.0-beta.2/iconify.min.js"></script>
|
<script src="https://code.iconify.design/2/2.0.0-beta.2/iconify.min.js"></script>
|
||||||
@ -251,7 +251,7 @@ Possible values for `data-rotate`: 90deg, 180deg, 270deg.
|
|||||||
|
|
||||||
If you use both flip and rotation, the icon is flipped first, then rotated.
|
If you use both flip and rotation, the icon is flipped first, then rotated.
|
||||||
|
|
||||||
To use custom transformations use CSS transform rule. Add `!important` after rule to override the SVG inline style (inline style exists to fix a SVG rendering bug in Firefox browser).
|
To use custom transformations use CSS transform rule. Add `!important` after rule to override the SVG inline style (inline style exists to fix an SVG rendering bug in Firefox browser).
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<span data-icon="twemoji-helicopter" class="iconify icon-helicopter"></span>
|
<span data-icon="twemoji-helicopter" class="iconify icon-helicopter"></span>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { readFileSync } from 'fs';
|
import { readFileSync, writeFileSync } from 'fs';
|
||||||
import resolve from '@rollup/plugin-node-resolve';
|
import resolve from '@rollup/plugin-node-resolve';
|
||||||
import commonjs from '@rollup/plugin-commonjs';
|
import commonjs from '@rollup/plugin-commonjs';
|
||||||
import buble from '@rollup/plugin-buble';
|
import buble from '@rollup/plugin-buble';
|
||||||
@ -10,7 +10,7 @@ const global = 'Iconify';
|
|||||||
|
|
||||||
// Wrapper to export module as global and as ES module
|
// Wrapper to export module as global and as ES module
|
||||||
const header = `/**
|
const header = `/**
|
||||||
* (c) Vjacheslav Trushkin <cyberalien@gmail.com>
|
* (c) Iconify
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the license.txt or license.gpl.txt
|
* For the full copyright and license information, please view the license.txt or license.gpl.txt
|
||||||
* files at https://github.com/iconify/iconify
|
* files at https://github.com/iconify/iconify
|
||||||
@ -45,9 +45,33 @@ const replacements = {};
|
|||||||
const packageJSON = JSON.parse(readFileSync('package.json', 'utf8'));
|
const packageJSON = JSON.parse(readFileSync('package.json', 'utf8'));
|
||||||
replacements['__iconify_version__'] = packageJSON.version;
|
replacements['__iconify_version__'] = packageJSON.version;
|
||||||
|
|
||||||
|
// Update README.md
|
||||||
|
let readme = readFileSync('README.md', 'utf8');
|
||||||
|
const oldReadme = readme;
|
||||||
|
const replaceCodeLink = (search) => {
|
||||||
|
let start = 0;
|
||||||
|
let pos;
|
||||||
|
while ((pos = readme.indexOf(search, start)) !== -1) {
|
||||||
|
start = pos + search.length;
|
||||||
|
let pos2 = readme.indexOf('/', start);
|
||||||
|
if (pos2 === -1) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
readme =
|
||||||
|
readme.slice(0, start) + packageJSON.version + readme.slice(pos2);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
replaceCodeLink('/code.iconify.design/2/');
|
||||||
|
replaceCodeLink('/@iconify/iconify@');
|
||||||
|
|
||||||
|
if (readme !== oldReadme) {
|
||||||
|
console.log('Updatead README');
|
||||||
|
writeFileSync('README.md', readme, 'utf8');
|
||||||
|
}
|
||||||
|
|
||||||
// Export configuration
|
// Export configuration
|
||||||
const config = [];
|
const config = [];
|
||||||
[false, true].forEach(compress => {
|
[false, true].forEach((compress) => {
|
||||||
const item = {
|
const item = {
|
||||||
input: `lib/${name}.js`,
|
input: `lib/${name}.js`,
|
||||||
output: [
|
output: [
|
||||||
|
Loading…
Reference in New Issue
Block a user