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

Revamp the software section #19

Merged
merged 15 commits into from
Dec 12, 2021
Merged

Revamp the software section #19

merged 15 commits into from
Dec 12, 2021

Conversation

alexfoias
Copy link
Contributor

@alexfoias alexfoias commented Aug 19, 2021

The purpose of this PR is to revamp the software page.

TODO after this PR:

@alexfoias alexfoias marked this pull request as ready for review August 19, 2021 15:01
@alexfoias alexfoias changed the title Fix software logo WIP: Fix software logo Aug 19, 2021
@alexfoias
Copy link
Contributor Author

Not sure how to vizualize the changes on the gitbook. I tried to build it in local (gitbook build or gitbook serve) but it didn't work. I'm currently exploring other options.

@jcohenadad
Copy link
Member

@alexfoias just checking if you are still working on this? (opened for a while)

@alexfoias
Copy link
Contributor Author

@jcohenadad I will work to make it work with the new version of the website. This issue was opened when we were on the gitbook platform.

@alexfoias
Copy link
Contributor Author

@kousu is there any way of seeing the built ? thanks

@alexfoias alexfoias changed the title WIP: Fix software logo Fix software logo Dec 3, 2021
@kousu
Copy link
Member

kousu commented Dec 3, 2021

@kousu is there any way of seeing the built ? thanks

For the record, yes, and this is currently documented here:

To build the docs:
pip install .[sphinx]
make html
They will end up in _build/html/

I didn't want to stick this on the main README.md because that would end up getting built in to the front page.

@alexfoias
Copy link
Contributor Author

@kousu It would be nice if we could implement CI to see the various branches.

@alexfoias
Copy link
Contributor Author

Screenshots of: 2f6bd49

Screen Shot 2021-12-03 at 1 51 38 PM

Screen Shot 2021-12-03 at 1 51 44 PM

I will have to fix the size of the images.

@jcohenadad what should I do with the software that doesn't have a logo ? For the moment I added the lab's logo given the fact that the repos are under the neuropoly organization.

@jcohenadad
Copy link
Member

I will have to fix the size of the images.

indeed

@jcohenadad what should I do with the software that doesn't have a logo ? For the moment I added the lab's logo given the fact that the repos are under the neuropoly organization.

i would leave it empty

@alexfoias
Copy link
Contributor Author

Screenshots from: de4cada

Screen Shot 2021-12-03 at 2 15 13 PM

Screen Shot 2021-12-03 at 2 15 17 PM

@jcohenadad
Copy link
Member

in #19 (comment) the ratio should be kept-- also i suggest to use the same height across all logos-- more cosmetic

@kousu
Copy link
Member

kousu commented Dec 4, 2021

@kousu It would be nice if we could implement CI to see the various branches.

I had suggestions about this in the original PR:

Github Pages is too simple to handle branches.

However someone could fork the repo, and so long as they're working on master their fork should automatically go live at https://username.github.io/neuropoly-docs.

I am also not against hosting on readthedocs especially if we do want PR previews. I have no horse in the RTD / Github race, they're both just companies to me; I demo'd this way because it meant one less credential to manage; and also PRs should be the exception not the rule.

Right now I think it's not that hard to just build it locally and share via screenshot, or just by having reviewers also build it locally. I built this process assuming the vast majority of edits would be one-off commit-to-master sort of deals with no need to preview.

But like I said if you want to show off your changes live instead of via screenshot you can

  1. Fork this repo
  2. Go to Settings > Pages in your fork
  3. Tell it to publish from gh-pages
  4. Settings > Pages will give you a URL you can look at it in

And in the extremely rare case you need to compare multiple live versions, you can just make multiple forks. Github won't let you do that directly from the Fork button but you just have to make a bunch of New repos then git push from the same local repo to each.

@kousu
Copy link
Member

kousu commented Dec 4, 2021

I have an idea: what if you combined the logo and name columns? Make sure to set alt and title attributes with the markdown image syntax:

![ivadomed](../.gitbook/asserts/logo_ivadomed.png "ivadomed")

So that mousing over will pop-up the name, and that looking at it in a screenreader or text-only/braille browser will still show the title.

And then for rows without a logo, like AxonPacking, you can just leave it as-is.

@kousu
Copy link
Member

kousu commented Dec 4, 2021

Also, I would make sure to copy the logos into the assets/ folder so that the site is self-contained.

@kousu
Copy link
Member

kousu commented Dec 4, 2021

I notice that the descriptions are centered while the docs link isn't anymore. I found the reason, it's this:

#open-source-projects table tr > :is(th,td):is(:nth-child(3),:nth-child(4)) {
text-align: center;
min-width: 15%; /* this forces these columns to get 30%, text-wrapping the description column as necessary */
}

because adding an extra column bumped the indexes all over. So, if you keep both logo and title columns, you'll have to bump those to 4,5 from 3,4 (but I'm still rooting over here in my tiny clown-car sized corner for merging the columns 🤡 🤡 🍰 )

@jcohenadad
Copy link
Member

jcohenadad commented Dec 4, 2021

Another suggestion would be to organize the software page as a gallery. I find it waaay cooler.

@kousu
Copy link
Member

kousu commented Dec 4, 2021

I think a gallery is a lot messier personally. It's a lot easier to get an overview from a table.

@jcohenadad
Copy link
Member

jcohenadad commented Dec 4, 2021

Here is the rendering of the software page as a gallery (in ef311af). The most democratic way is to vote with 👍 /👎

image

Updated version with the software description:
image

Note: I'm aware the logos need to be vertically aligned, but i wasn't able to do it. Since this is not a priority it can be addressed later in #48

@jcohenadad jcohenadad changed the title Fix software logo Revamp the software section Dec 4, 2021



# -- Custom scripts ----------------------------------------------------------
Copy link
Member

Choose a reason for hiding this comment

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

This line should be above

Copy link
Member

Choose a reason for hiding this comment

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

thanks, fixed in 176ebe5


LOGGER = logging.getLogger("conf")

def build_gallery(app: Sphinx):
Copy link
Member

@kousu kousu Dec 4, 2021

Choose a reason for hiding this comment

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

It's inelegant to do all this in the conf.py file, running it on every parse like this.

It would be significantly cleaner to package this script as a custom directive, stick it up on pypi, and then instead of

```{include} gallery.txt

```

do

```{gallery}
- name: Spinal Cord Toolbox
  website: https://spinalcordtoolbox.com/
  repository: https://github.com/spinalcordtoolbox/spinalcordtoolbox
  image: https://raw.githubusercontent.com/spinalcordtoolbox/spinalcordtoolbox/master/documentation/source/_static/img/logo_sct.png
- name: ivadomed
  website: https://ivadomed.org
  repository: https://github.com/ivadomed/ivadomed
  image: https://raw.githubusercontent.com/ivadomed/ivadomed/master/images/ivadomed_logo.png
- name: qMRLab
  website: https://qmrlab.readthedocs.io
  repository: https://github.com/qMRLab/qMRLab
  image: https://raw.githubusercontent.com/qMRLab/documentation/master/logo/qMR_logo_orig.png
- name: Shimming Toolbox
  website: https://shimming-toolbox.org
  repository: https://github.com/shimming-toolbox
  image: https://raw.githubusercontent.com/shimming-toolbox/shimming-toolbox/master/docs/source/_static/img/shimming_toolbox_logo.png
- name: AxonDeepSeg
  website: https://axondeepseg.readthedocs.io/
  repository: https://github.com/neuropoly/axondeepseg
  image: https://raw.githubusercontent.com/neuropoly/axondeepseg/master/docs/source/_static/logo_ads-alpha.png
```

Copy link
Member

Choose a reason for hiding this comment

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

and those images should be inlined

Copy link
Member

Choose a reason for hiding this comment

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

agreed-- but i don't have the time to do it, so #47

gallery.yml Outdated
- name: Spinal Cord Toolbox
website: https://spinalcordtoolbox.com/
repository: https://github.com/spinalcordtoolbox/spinalcordtoolbox
image: https://raw.githubusercontent.com/spinalcordtoolbox/spinalcordtoolbox/master/documentation/source/_static/img/logo_sct.png
Copy link
Member

Choose a reason for hiding this comment

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

These images should be inlined

Copy link
Member

@jcohenadad jcohenadad Dec 4, 2021

Choose a reason for hiding this comment

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

i don't understand this comment (ie: what do you mean by 'inlined'?)

setup.py Outdated
Comment on lines 23 to 24
"sphinx-design~=0.0.11",
# pinned because of this bug https://github.com/pydata/pydata-sphinx-theme/pull/509
Copy link
Member

Choose a reason for hiding this comment

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

careful, this changed the meaning of the comment

Copy link
Member

Choose a reason for hiding this comment

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

my bad, fixed in 72c5bf1

random.shuffle(projects)
for item in projects:
if not item.get("image"):
item["image"] = "https://jupyterbook.org/_images/logo-square.svg"
Copy link
Member

Choose a reason for hiding this comment

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

This image should be inlined

Copy link
Member

Choose a reason for hiding this comment

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

my bad, fixed in 72c5bf1

conf.py Outdated
LOGGER.info("building gallery...")
grid_items = []
projects = yaml.safe_load((Path(app.srcdir) / "gallery.yml").read_text())
random.shuffle(projects)
Copy link
Member

Choose a reason for hiding this comment

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

'shuffle'?

Copy link
Member

Choose a reason for hiding this comment

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

ah! thanks, i was wondering why they were shuffled 😅

fixed in c3e6c8c

@@ -34,6 +34,7 @@
extensions = [
'myst_parser', # there's also myst_nb, which supports embedding Jupyter notebooks, but is heavier.
'sphinx_panels',
'sphinx_design',
Copy link
Member

Choose a reason for hiding this comment

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

This is a strange dependency. It pulls in bootstrap? But bootstrap has already been deprecated for several years by the existence of https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layout/Grids. If I look at the web debugger in https://sphinx-design.readthedocs.io/en/sbt-theme/grids.html#grid-options I see they're not using that at all though:

2021-12-04-173551_337x69_scrot

Copy link
Member

Choose a reason for hiding this comment

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

this is needed, otherwise on compilation i get:

/Users/julien/code/neuro.polymtl.ca/gallery.txt:2: WARNING: Unknown directive type "grid".

@jcohenadad jcohenadad merged commit 9d6b81f into master Dec 12, 2021
@jcohenadad jcohenadad deleted the af/fix_software branch December 12, 2021 17:13
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