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

Amend Codeblocks, add highlight and format markdown #389

Merged
merged 4 commits into from
Mar 27, 2019

Conversation

jason-fox
Copy link
Contributor

This PR fixes the white-code-on-a-white-background issue found in the current Wirecloud documentation:

Screenshot 2019-03-26 at 10 40 05

The existing pymdownx.superfences and codehilite extensions conflict with the standard FIWARE CSS settings. I've commented out the extensions and added appropriate code syntax throughout the documentation. I've also formatted the markdown to avoid any other ReadTheDocs rendering issues

@aarranz aarranz self-requested a review March 26, 2019 11:39
Copy link
Member

@aarranz aarranz left a comment

Choose a reason for hiding this comment

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

Hi @jason-fox, thank you very much for your contribution!

I have done only a first review as you are making a very big change, but this is a first batch of things that I think should be changed before merging.

Best regards.


```
```text
Copy link
Member

Choose a reason for hiding this comment

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

This block contains a shell script (with comments but a shell script)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed fb9c400

documentation](https://channels.readthedocs.io/en/latest/deploying.html).
- Install [Django channels](https://channels.readthedocs.io/en/latest/):

```bash
Copy link
Member

Choose a reason for hiding this comment

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

This block has lost indentation (due pymdownx.superfences removal)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not done, since <zbr> should be sufficient:

Screenshot 2019-03-26 at 15 06 06

mkdocs.yml Outdated
@@ -33,16 +33,16 @@ markdown_extensions:
- pymdownx.betterem
- pymdownx.tilde:
subscript: False
- pymdownx.superfences
# - pymdownx.superfences
Copy link
Member

Choose a reason for hiding this comment

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

This extension is not conflicting at all, it is only conflicting when using it jointly with the codehilite extension, that is the extension conflicting with the highlight.js library used by the FIWARE Style. So, please, maintain the pymdownx.superfences extension and revert all the changes required due to its removal.

Copy link
Contributor Author

@jason-fox jason-fox Mar 26, 2019

Choose a reason for hiding this comment

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

Superfences is causing an issue - compare this:

Screenshot 2019-03-26 at 14 54 12

With the proper XML style shown below.

Screenshot 2019-03-26 at 14 24 25

Font is too small to read attributes have a hard black background, the red has insufficient contrast - superfences just makes this ugly (and there is a fix for blocks - see below)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've removed both of the extensions for improved readability. Fixed - 811dbf4

  • codehighlight is causing the white background
  • superfences has font size and highlighting issues.

Neither extension is used elsewhere in the FIWARE documentation

mkdocs.yml Outdated
- pymdownx.magiclink:
repo_url_shortener: True
repo_url_shorthand: True
provider: "github"
user: "Wirecloud"
repo: "wirecloud"
- pymdownx.tasklist
- codehilite:
guess_lang: False
# - codehilite:
Copy link
Member

Choose a reason for hiding this comment

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

If the extension is problematic, we should remove it from mkdocs.yml instead of commenting it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed 811dbf4 - Extensions removed

$ git clone https://github.com/Wirecloud/wirecloud.git
$ cd wirecloud
$ git checkout 1.0.x
```bash
Copy link
Member

Choose a reason for hiding this comment

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

Fix indentation (pymdownx.superfences)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not Done - color should be sufficient here:

Screenshot 2019-03-26 at 15 08 19

WireCloud in this case for a production ready environment, in the meantime, you
can take a look into the [Django channels
documentation](https://channels.readthedocs.io/en/latest/deploying.html).
- Install [Django channels](https://channels.readthedocs.io/en/latest/):
Copy link
Member

Choose a reason for hiding this comment

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

Recover step numbers (lost due pymdownx.superfences removal)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is possible to get the step numbers back without superfences through judicious use of the <zbr> directive as shown:

Screenshot 2019-03-26 at 14 59 21

As you can see, there is a slight indent, and the code is highly readable.

Fixed fb9c400

>>> django.VERSION
(1, 5, 5, 'final', 0)
```bash
$ python
Copy link
Member

Choose a reason for hiding this comment

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

One block using the console language. Splitting here is weird.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed fb9c400

[Solr]: http://lucene.apache.org/solr/
[ElasticSearch2]: https://www.elastic.co/products/elasticsearch
[Whoosh]: https://whoosh.readthedocs.io/en/latest/
[solr]: http://lucene.apache.org/solr/
Copy link
Member

Choose a reason for hiding this comment

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

Although this is not breaking documentation, I'm curious, why to change them to low case if the references on the paragraphs maintains the capitalisation?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed fb9c400 - I've inlined the URLs - it is better markdown practice anyway.


#### Apache 2.2

You can use this template as starting point:

```ApacheConf
```xml
Copy link
Member

Choose a reason for hiding this comment

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

It would be great if the FIWARE style provides some fixes for the horrendous colours used by hightlight.js for the apacheconf language. It's the only reason to allow you to use xml here, hehe.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The FIWARE XML colours are quite harmonious, and work well over soft black:

Screenshot 2019-03-26 at 14 24 25

And perhaps more importantly they are consistent.

Copy link
Member

@aarranz aarranz Mar 26, 2019

Choose a reason for hiding this comment

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

Well, I mean the colours applied when using the apacheconf language:

Captura de pantalla 2019-03-26 a las 19 59 42

I mainly complain about the red colour, but if you find it harmonious, then switch them back to use apacheconf 😉. apacheconf is the correct language for apache config files (they are not xml files).

With the current colour scheme, I prefer to use the xml language 😄.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ahhhh - got it. But as you can see (ignoring the red for the moment) it is now using FIWARE CSS Pink, Yellow and Purple. This means improving the brightness of the red would just be another CSS change on within the CSS files held by the FIWARE Foundation.

I can look into that after this PR has been processed. Let's leave it XML for now and potentially change it again later.

Copy link
Member

Choose a reason for hiding this comment

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

ok

www-data 3818 3811 0 68663 39820 0 13:13 ? 00:00:00 /usr/sbin/apache2 -k start
www-data 3819 3811 0 68687 39448 0 13:13 ? 00:00:00 /usr/sbin/apache2 -k start
www-data 3822 3811 0 68901 40160 0 13:13 ? 00:00:00 /usr/sbin/apache2 -k start
```bash
Copy link
Member

Choose a reason for hiding this comment

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

don't split, use the console language.

Copy link
Contributor Author

@jason-fox jason-fox Mar 26, 2019

Choose a reason for hiding this comment

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

Unfortunately your default choices here are bash or text - console isn't supported on readthedocs.

Split removed fb9c400

@coveralls
Copy link

coveralls commented Mar 26, 2019

Coverage Status

Coverage decreased (-0.005%) to 78.875% when pulling 5014013 on jason-fox:feature/codeblock into c177864 on Wirecloud:develop.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 78.88% when pulling 811dbf4 on jason-fox:feature/codeblock into c177864 on Wirecloud:develop.

@aarranz aarranz merged commit 27abd2d into Wirecloud:develop Mar 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants