Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc/doxygen: remove support for lesscpy #11037

Merged
merged 2 commits into from
Mar 6, 2019

Conversation

cladmi
Copy link
Contributor

@cladmi cladmi commented Feb 20, 2019

Contribution description

lessc (node-less) and lesscpy do not produce the same output.
There are some minor whitespace +-1 in color values which
are not important but the output file is not stable

However lesscpy removes comments and so the license of the output file
As it produces an invalid file it support is dropped.

https://lesscpy.readthedocs.io/en/latest/#differences-from-less-js

Apparently when it was added by #7607 the output was not checked.

Alternative solution

Decide we do not care about the license header in riot.css and only use lesscpy instead of node-less.
Not a valid alternative #11037 (comment)

Testing procedure

I used this diff to show the command being executed:

diff --git a/doc/doxygen/Makefile b/doc/doxygen/Makefile
index 300739358..293daf17b 100644
--- a/doc/doxygen/Makefile
+++ b/doc/doxygen/Makefile
@@ -22,7 +22,7 @@ man: src/changelog.md

 ifneq (,$(LESSC))
 src/css/riot.css: src/css/riot.less src/css/variables.less
-       @$(LESSC) $< $@
+       $(LESSC) $< $@

 src/css/variables.less: src/config.json
        @grep "^\s*\"@" $< | sed -e 's/^\s*"//g' -e 's/":\s*"/: /g' \

With node-less installed and touching riot.less the file is rebuilt:
See the /usr/bin/lessc src/css/riot.less src/css/riot.css line:

touch doc/doxygen/src/css/riot.less

make doc
"make" -BC doc/doxygen
make[1]: Entering directory '/home/harter/work/git/RIOT/doc/doxygen'
/usr/bin/lessc src/css/riot.less src/css/riot.css
( cat riot.doxyfile ; echo "GENERATE_HTML = yes" ) | doxygen -
*make[1]: Leaving directory '/home/harter/work/git/RIOT/doc/doxygen'

If LESSC is empty it is not:

touch doc/doxygen/src/css/riot.less

LESSC= make doc
"make" -BC doc/doxygen
make[1]: Entering directory '/home/harter/work/git/RIOT/doc/doxygen'
( cat riot.doxyfile ; echo "GENERATE_HTML = yes" ) | doxygen -
*make[1]: Leaving directory '/home/harter/work/git/RIOT/doc/doxygen'

And if node-less is not installed it is not rebuild

command -v lessc

touch doc/doxygen/src/css/riot.less

make doc
"make" -BC doc/doxygen
make[1]: Entering directory '/home/harter/work/git/RIOT/doc/doxygen'
( cat riot.doxyfile ; echo "GENERATE_HTML = yes" ) | doxygen -
*make[1]: Leaving directory '/home/harter/work/git/RIOT/doc/doxygen'

Issues/PRs references

The file was always being modified and said different from the version of the repository when doing make doc with only lesscpy installed.

I mentioned the issue with the comments being removed in #10249 (comment)

lessc (node-less) and lesscpy do not produce the same output.
There are some minor whitespace +-1 in color values which
are not important but the output file is not stable

However lesscpy removes comments and so the license of the output file
As it produces an invalid file it support is dropped.

https://lesscpy.readthedocs.io/en/latest/#differences-from-less-js
Add package name in ubuntu for lessc.
@cladmi cladmi added Area: doc Area: Documentation Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation labels Feb 20, 2019
@cladmi cladmi requested review from miri64 and jcarrano February 20, 2019 10:41
@cladmi
Copy link
Contributor Author

cladmi commented Feb 20, 2019

@miri64 as you added the riot.css file in the first place, I think you may have an opinion about caring about the license header here or not.

@miri64 miri64 requested a review from jnohlgard February 20, 2019 11:19
@miri64
Copy link
Member

miri64 commented Feb 20, 2019

lesscpy w was introduced by @gebart in d01d91d, so I'd like to have his opinion on this as well.

@miri64 as you added the riot.css file in the first place, I think you may have an opinion about caring about the license header here or not.

If lesscpy is the one removing the license header and lesscpy is the one removed here I don't really understand that comment... However, I don't really care about that header in the generated result, as long as it stays in in the upstream repo.

@cladmi
Copy link
Contributor Author

cladmi commented Feb 20, 2019

If lesscpy is the one removing the license header and lesscpy is the one removed here I don't really understand that comment... However, I don't really care about that header in the generated result, as long as it stays in in the upstream repo.

Sorry for not being precise, I was asking about having the alternative solution and use lesscpy to generate a file without header by default.

If the tool is generating a file without header, it would mean keeping the file without header in the repository as the generated file is tracked. Otherwise you end up in a state where you cannot generate it anymore.

The generated file is here https://github.com/RIOT-OS/RIOT/blob/master/doc/doxygen/src/css/riot.css and the source file has riot.css in the description:

/*
* riot.css
* Copyright (C) 2017 Freie Universität Berlin
*
* Distributed under terms of the LGPLv2.1 license (see LICENSE file).
*/

@miri64
Copy link
Member

miri64 commented Feb 20, 2019

Since the generated file is the one exposed on the website, I'd prefer to keep in the copyright header.

@cladmi
Copy link
Contributor Author

cladmi commented Feb 20, 2019

Since the generated file is the one exposed on the website, I'd prefer to keep in the copyright header.

Ok that what I was thinking, but prefered to ask. I strike the alternative then.

@cladmi cladmi added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Feb 20, 2019
Copy link
Contributor

@jcarrano jcarrano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a note, "less" (and not "lesscpy") is what is installed in riotdocker (and therefore in Travis.)

@jcarrano jcarrano merged commit 6c7984e into RIOT-OS:master Mar 6, 2019
@cladmi
Copy link
Contributor Author

cladmi commented Mar 6, 2019

less is not lessc :)

None of lessc and lesscpy is currently installed in riotdocker image.

I re-updated the image just to be sure:

sudo docker run -i --rm riot/riotbuild   lessc --help
/run.sh: line 16: lessc: command not found
sudo docker run -i --rm riot/riotbuild   lesscpy --help
/run.sh: line 16: lesscpy: command not found

@cladmi cladmi deleted the pr/doc/remove_lesscpy branch March 6, 2019 15:49
@miri64
Copy link
Member

miri64 commented Mar 7, 2019

less is not lessc :)

Yes... less is a terminal pager tool. lessc is a LESS compiler, with LESS (Leaner Style Sheets) being a pre-processable style sheet language that can be compiled to CSS ;-).

@danpetry danpetry added this to the Release 2019.04 milestone Mar 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: doc Area: Documentation CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants