Skip to content

Commit

Permalink
Standardize node.js requirements.
Browse files Browse the repository at this point in the history
  • Loading branch information
felixfontein committed Mar 10, 2024
1 parent c49bbec commit f10b183
Show file tree
Hide file tree
Showing 7 changed files with 1,711 additions and 14 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build-css.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ jobs:

- name: Install dependencies
run: |
npm install -g sass autoprefixer cssnano postcss postcss-cli
npm clean-install
working-directory: ./src/sphinx_antsibull_ext/css

- name: Build CSS
run: |
Expand Down
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,10 @@ cd sphinx_antsibull_ext/css/
./build-css.sh
```

For this to work, you need to make sure that `sassc` and `postcss` are on your path and that the autoprefixer and nanocss modules are installed:
For this to work, you need to install some Node.js dependencies:

```console
# Debian:
apt-get install sassc

# PostCSS, autoprefixer and cssnano require nodejs/npm:
npm install -g autoprefixer cssnano postcss postcss-cli
npm clean-install
```

## Creating a new release:
Expand Down
2 changes: 1 addition & 1 deletion src/sphinx_antsibull_ext/antsibull-minimal.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/sphinx_antsibull_ext/css/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright (c) Ansible and contributors
# GNU General Public License v3.0+ (see https://www.gnu.org/licenses/gpl-3.0.txt)

/node_modules
12 changes: 6 additions & 6 deletions src/sphinx_antsibull_ext/css/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later

SASS=${SASS_COMPILER:-$(which sass)}
POSTCSS=${POSTCSS:-$(which postcss)}
SASS=${SASS_COMPILER:-node_modules/.bin/sass}
POSTCSS=${POSTCSS:-node_modules/.bin/postcss}

if [ "${SASS}" == "" ]; then
echo "Need 'sass' on path. You can install sass with 'npm install sass'."
if [ ! -x "${SASS}" ]; then
echo "${SASS} is not executable. Did you run 'npm install'?"
exit -1
fi

if [ "${POSTCSS}" == "" ]; then
echo "Need 'postcss' on path. You can install postcss and the required plugins with 'npm install autoprefixer cssnano postcss postcss-cli'."
if [ ! -x "${POSTCSS}" ]; then
echo "${POSTCSS} is not executable. Did you run 'npm install'?"
exit -1
fi

Expand Down
Loading

0 comments on commit f10b183

Please sign in to comment.