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

tutorial: Modify links to pattern tutorialName-Author1-Authorn_languageSuffix #9

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

DouSam
Copy link
Contributor

@DouSam DouSam commented Jan 30, 2025

All the tutorials have their name changed to follow the pattern.

…ageSuffix`

All the tutorials have their name changed to follow the pattern.
Copy link

netlify bot commented Jan 30, 2025

Deploy Preview for training-slicer-org ready!

Name Link
🔨 Latest commit dcbfb03
🔍 Latest deploy log https://app.netlify.com/sites/training-slicer-org/deploys/679b45dfd4b61c0008632efe
😎 Deploy Preview https://deploy-preview-9--training-slicer-org.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@jcfr
Copy link
Member

jcfr commented Jan 30, 2025

Thanks for working on this 🙏

So that we can document the guidelines for anyone working on contributing training materials, I suggest we spend more time describing the convention to have an ambiguous and systematic way of deriving the file name from the tutorial title.

Looks like the convention seems to be further specified. I propose the following:

- tutorialName-Author1-AuthorN_languageSuffix
+ [Slicer]<TutorialBaseName>[Tutorial]-<Author1>[-<Author2>[...]]_<language>[_<region>].(pdf|md|html)

where:

  • <TutorialBaseName> is the "camelized" title of the tutorial. The suffix Tutorial is appended if not already part of the name. See camelize section below. For examples:
    • "Welcome Tutorial" -> SlicerWelcomeTutorial
    • "Basics of Data Loading and Visualization" -> SlicerBasicsOfDataLoadingAndVisualizationTutorial
    • "Data Loading and 3D Visualization" -> SlicerDataLoadingAnd3DVisualizationTutorial
    • "DICOM Image Visualization" -> SlicerDicomImageVisualizationTutorial
  • <AuthorN> is the Nth author of the source tutorial
    • The source tutorial is most likely the one written in american English and assumed to have en_US as <language>[_<region>]
    • Author is specified as camelize(first_name)[0] + camelize(last_name)

References:

Questions

Can we revisit the approach for generating the BaseFileName of training material document ?

In the proposed pull request, it looks like the tutorial is inconsistently named:

  • For "Welcome Tutorial" it uses the convention described above
  • For "Basics of Data Loading and Visualization" it uses Slicer<LastWordOfTitle>Tutorial ()
  • For "Data Loading and 3D Visualization" it uses Slicer<CamelizeWordsWithout3D>Tutorial (SlicerDataLoadingAndVisualizationTutorial)
  • For "DICOM and Slicer" it uses 3DSlicer<FirstWordOfTitle>Tutorial (3DSlicerDICOMTutorial)

I suggest we revisit to have a systematic way of naming the files.

What to do if additional author contribute to an existing tutorial ?

Using <Author1>[-<Author2>[...]] should be further specified, may be it could be specified as the list of author up the 3rd one ?

Should we standardize on <language>[_<region>] or [-] ?

Since the _ seems to be used to visualize separate the different part in the filename, using - may be more appropriate ...

How do we cite tutorials ?

Do we want to have the tutorial to be cited ? Or do we want to redirect people to the citing guideline of Slicer. See https://slicer.readthedocs.io/en/latest/user_guide/about.html#how-to-cite

Related references:

Convenient script & CLI to "camelize" tutorial name

import re

def camelize(s):
    words = re.split(r'[^a-zA-Z0-9]', s)
    return ''.join(word.capitalize() for word in words if word)

or

python3 -c "import re, sys; camelize=lambda s: re.sub(r'[^a-zA-Z0-9]', ' ', s).title().replace(' ', ''); print(camelize(sys.argv[1]))"

@jcfr
Copy link
Member

jcfr commented Jan 30, 2025

cc: @lassoan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants