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

Syntax for links #122

Open
njr2128 opened this issue Jul 1, 2024 · 26 comments
Open

Syntax for links #122

njr2128 opened this issue Jul 1, 2024 · 26 comments

Comments

@njr2128
Copy link
Member

njr2128 commented Jul 1, 2024

Follow the instructions as outlined in our READ ME: https://github.com/cu-mkp/research-teaching-companion?tab=readme-ov-file#internal-links

  • use markdown syntax [text for link](link)
  • anchor the links with the root - start at root directory eg [Stucco for Molding](/resources/activity-sheets/stucco-assignment) -- and make sure the / is there at the beginning of the file path!
  • make sure the file path is correct (that it follows the directory structure in full, eg [stucco assignment](/documents/activity-sheets/stucco_assignment_student-handout.pdf)
@njr2128
Copy link
Member Author

njr2128 commented Jul 1, 2024

I've made this issue so you can make any changes you want now

@ps2270
Copy link
Contributor

ps2270 commented Jul 1, 2024 via email

@ps2270
Copy link
Contributor

ps2270 commented Jul 1, 2024 via email

@ps2270
Copy link
Contributor

ps2270 commented Jul 8, 2024

I think I've diagnosed the html internal links problem:
this kind of syntax - [Stucco for Molding]({{< ref "/documents/activity-sheets/stucco-assignment.pdf" >}}) - only works (for now) for /resources NOT for /documents

@njr2128
Copy link
Member Author

njr2128 commented Jul 18, 2024

For NJR/THC to check: a good page with lots of links that does not work presently with markdown syntax: https://teaching640.makingandknowing.org/resources/activity-sheets/activitysheet_jasper

@njr2128
Copy link
Member Author

njr2128 commented Jul 19, 2024

For NJR/THC to check: a good page with lots of links that does not work presently with markdown syntax: https://teaching640.makingandknowing.org/resources/activity-sheets/activitysheet_jasper

@ps2270
Diagnosed! All .md pages need to have a trailing /, so:
https://teaching640.makingandknowing.org/resources/activity-sheets/activitysheet_jasper
becomes
https://teaching640.makingandknowing.org/resources/activity-sheets/activitysheet_jasper/

@njr2128
Copy link
Member Author

njr2128 commented Jul 19, 2024

fix missing space between ref and <
image

njr2128 added a commit that referenced this issue Jul 19, 2024
@njr2128
Copy link
Member Author

njr2128 commented Jul 24, 2024

Links to other pages (i.e., .md files under content/):

[Making Varnishes](/resources/activity-sheets/activitysheet_varnishes/)
[Digital Project](/resources/digital/EXAMPLEPAGE/)
[Bibliography](/resources/reflection/bibliography/)
[Student Project - Alberts](/resources/student-projects/fa21_alberts_naomi_final-project_ph-lesson/)
[Syllabus SP23](/resources/reflection/syllabi/syllabus_sp23_gu4962-hands-on-history/)

Links to pdfs, handouts, etc (i.e., files under static/):

[pdf example](/documents/pdf/activitysheet_Jasper_preparation-of-horn.pdf)
[docx example](/documents/docx/activitysheet_Jasper_preparation-of-horn.docx)

Images:

![jasper-part3](/images/jasper-part3.png)

njr2128 added a commit that referenced this issue Jul 24, 2024
njr2128 added a commit that referenced this issue Jul 25, 2024
@njr2128
Copy link
Member Author

njr2128 commented Jul 25, 2024

In this doc: https://github.com/cu-mkp/research-teaching-companion/blob/main/content/resources/activity-sheets/activitysheet_varnishes.md
[PDF]({{< ref "/documents/pdf/activitysheet_varnishes-protocol-slsv.pdf" >}})
needs to become:
[PDF](/documents/pdf/activitysheet_varnishes-protocol-slsv.pdf)

njr2128 added a commit that referenced this issue Jul 25, 2024
@njr2128
Copy link
Member Author

njr2128 commented Jul 25, 2024

And maybe with only file name (no path):
[PDF]({{< ref "activitysheet_varnishes-protocol-slsv.pdf" >}})

@njr2128
Copy link
Member Author

njr2128 commented Jul 25, 2024

Search regular expression: \(\{\{< ref \"([\_\-\w]+)\" >\}\}\) to get all instances of links using "ref" with file name only (no file extension or file path)
ref-with-file-name-only-md-files.txt

replace with: \($1\)
\ = escapes the following character which has special meaning in regular expressions
\w = any alphanumeric character
\( or \{ = escaped characters ( or {, that is, they are searched for literally
(...) = unescaped parentheses = creates a pattern that is saved as a replacement pattern using $1 in the "replace with"
[...] = unescaped brackets = creates a group of characters or character classes to be matched
+ = specifies that it is one or more of any characters in the group

image

@njr2128
Copy link
Member Author

njr2128 commented Jul 25, 2024

To find any instances of ref links with no file extensions but with / in the reference (ie they have some level of their file path)
To find: \(\{\{< ref \"([\/\_\-\w]+)\" >\}\}\)
To replace: \($1/\) [adds a trailing slash as all instances were missing them]
image

@njr2128
Copy link
Member Author

njr2128 commented Jul 25, 2024

any instances with file extension (with or without file path)
to find: \(\{\{< ref \"([\.\/\_\-\w]+)\" >\}\}\)
to replace: \($1\)

image

@njr2128
Copy link
Member Author

njr2128 commented Jul 25, 2024

For the few files that have + in their name
To find: \(\{\{< ref \"([\+\.\/\_\-\w]+)\" >\}\}\)

@njr2128
Copy link
Member Author

njr2128 commented Jul 25, 2024

To remove any file references with .md
To find: .md)
To replace: /)
NOT regular expression

@njr2128
Copy link
Member Author

njr2128 commented Jul 31, 2024

@ps2270 found additional broken links that she corrected as she was going through but did not document in this issue. I want to document some of these to see if there are other similar issues here. So, we are reviewing some of her commits.

One example is c6b7a87 where there is /static/documents/ instead of /documents/

Another example is missing a leading slash as here: cdb7d03

Another: inclusion of /content/resources instead of /resources/ 16fdd01

Another is missing training slashes 029ff76 and 49261f5

missing trailing slashes and missing /resources/activity-sheets/ 1b3fbc4 and 811cd16

@njr2128
Copy link
Member Author

njr2128 commented Jul 31, 2024

latest build to site (2024-07-31 at 1:30pm ET) returned no warnings or missing links files. This does not mean it doesn't have problems, but at least according to Hugo, it doesn't see any errors

@njr2128
Copy link
Member Author

njr2128 commented Jul 31, 2024

NEXT: in oxygen, search for the common problems as found by PHS (described two comments ago) to double check that there are no other ones

@njr2128
Copy link
Member Author

njr2128 commented Jul 31, 2024

@njr2128
Copy link
Member Author

njr2128 commented Aug 6, 2024

@ps2270 found additional broken links that she corrected as she was going through but did not document in this issue. I want to document some of these to see if there are other similar issues here. So, we are reviewing some of her commits.

One example is c6b7a87 where there is /static/documents/ instead of /documents/
Done - no issues

Another example is missing a leading slash as here: cdb7d03

PDFs:

Description: - [Presentation: Dyeing: Step-by-Step Instructions](rosenkranz_2018_dyes_cochineal-step-by-step.pdf) with information about sourci...
Description: - [Activity Sheet: Mordant Dyeing General Procedure](rosenkranz_2019_dyes_handout_general-mordant-and-dye-processes.pdf) - procedur...
Description: - [Activity Sheet: Mordant Dyeing with Cochineal](rosenkranz_2018_dyes_handout_dyeing-with-cochineal.pdf) - instructions for mor...
Description: [Presentation: Cochineal Dye: History, Chemistry, and Preparation](2023_dyes_cochineal-history-chem-prep_TAMU-compressed.pdf)
Description: - [Dyeing Instructions - General Process for Mordanting and Dyeing Textiles](sp23_handout_dyeing-textiles_general-process.pdf)
Description: - [Summary of Dye Samples and Measurements](sp23_printout_samples-amounts.pdf)
Description: - [Recipe Example: *De' secreti del reverendo signore Alessio Piemontese* (1558)](sp23_printout_recipe-example-piemontese.pdf)
Description: - [Activity Sheet: Mordant Dyeing General Procedure](rosenkranz_2019_dyes_handout_general-mordant-and-dye-processes.pdf)

XLSX:
Description: - [Template and recipes: natural dyes](rosenkranz_2019_dyes_TEMPLATE-AND-RECIPES_dye-experiments.xlsx) - a spreadshee...

Non-pdfs:

/mnt/c/Users/naomi/Downloads $ grep 'Description' close-bracket-open-paren-any-character.txt | grep -v 'http'| grep -v 'pdf'
Description: ...he content of Ms. Fr. 640. The Companion contains [Making and Knowing Syllabi](syllabi) for each of the eight versions of Craft and Science, focused each yea...
Description: ...udents explore Secrets of Craft and Nature to create sample [Student projects](student-projects)&mdash;involving all kinds of research&mdash;that extends the...
Description: ...streamline the hands-on work that our step-by-step [Lesson Plans for Hands-On](activity-sheets), emerged. As you can see in the [Making & Knowing Syllabi](/r...
Description: ...ng hands-on activities can be found in the Project's [Reflections on Hands-On](reflection).
Description: ...y that underlie the edition and our digital publication tool, [EditionCrafter](LINK). Student projects resulting from these courses are included in this Comp...
Description: ...have students prepare their sample cards ahead of time. Here is the [template](images/sp24_uchacz_tianna_paint-grid-arts-150_global-art-history-survey.png) I...
Description: - [Dyeing Textiles with Cochineal - A Short High-School Workshop](sp23_brown-reece_final-project_dye-workshop) by Reece Brown (an undergraduate...
Description: - [Spring 2023 HIST GU4962: Hands-on History Syllabus](syllabus_sp23_gu4962-hands-on-history)
Description: - [Activity Sheet: Calculating ratios and amount of material needed](rosenkranz_2019_dyes_handout_reconstruction-exchange_dyeing-with-natural-color...
Description: - [Template and recipes: natural dyes](rosenkranz_2019_dyes_TEMPLATE-AND-RECIPES_dye-experiments.xlsx) - a spreadshee...
Description: ...[Hands-on Lesson Plans, Activities, Assignments, and Reconstruction Protocols](index-activity-assignments.html)
Description: ...[Hands-on Lesson Plans, Activities, Assignments, and Reconstruction Protocols](index-activity-assignments/)
Description: - [DYE AND MORDANT RECIPES](rosenkranz_2019_dyes_handout_reconstruction-exchange_dyeing-with-natural-color...
Description: - I used the ratios from the [DYE AND MORDANT RECIPES](rosenkranz_2019_dyes_handout_reconstruction-exchange_dyeing-with-natural-color...
Description: - [Student Lab Guide](sp23_brown_reece_final-project_dye-workshop-student-lab-guide) (also available...
Description: - [Instructor Lab Guide](sp23_brown_reece_final-project_dye-workshop-instructor-lab-guide) (also availa...
Description: [<u>[email protected]</u>](mailto:[email protected]).
Binary file close-bracket-open-paren-any-character.txt matches

Another: inclusion of /content/resources instead of /resources/ 16fdd01
(resources/ and (documents/ and (/content/ and (content/ and (/static/ and (static/-- checked by THC. done. All are correct

Another is missing training slashes 029ff76 and 49261f5

missing trailing slashes and missing /resources/activity-sheets/ 1b3fbc4 and 811cd16

none with .md

njr2128 added a commit that referenced this issue Aug 6, 2024
njr2128 added a commit that referenced this issue Aug 6, 2024
njr2128 added a commit that referenced this issue Aug 6, 2024
@njr2128
Copy link
Member Author

njr2128 commented Aug 6, 2024

Find any links with markdown syntax and no leading slash:
in oxygen, run over 'content':
To find: \]\(\w

njr2128 added a commit that referenced this issue Aug 6, 2024
njr2128 added a commit that referenced this issue Aug 6, 2024
njr2128 added a commit that referenced this issue Aug 6, 2024
@njr2128
Copy link
Member Author

njr2128 commented Aug 6, 2024

Files fixed in commits dated today (2024-08-06):
desc-file-name-03.csv

@njr2128
Copy link
Member Author

njr2128 commented Aug 6, 2024

NEXT:

  • any links missing trailing slash

@ps2270
Copy link
Contributor

ps2270 commented Aug 6, 2024

@njr2128
FYI:
links on the "About M&K page" - links to internal web pages don't work because syntax is wrong, e.g. <[Credits] (/credits/)>.
(I've put a space between the ] and ( so it doesn't render as a hyperlink)

ps2270 added a commit that referenced this issue Aug 7, 2024
#122 
figuring index syntax
@njr2128
Copy link
Member Author

njr2128 commented Aug 9, 2024

@njr2128 FYI: links on the "About M&K page" - links to internal web pages don't work because syntax is wrong, e.g. <[Credits] (/credits/)>. (I've put a space between the ] and ( so it doesn't render as a hyperlink)

I'm a little confused. For pages that are in the same directory level AND are in the top-most directory of content/ (eg about.md and credits.md seen in screenshot below), the correct link syntax is as follows:
image

On the about.md page, to link to credits.md: [Credits](/credits/)
This works on the teaching640 site: the link to credits on https://teaching640.makingandknowing.org/about/ opens this page: https://teaching640.makingandknowing.org/credits/

@ps2270
Copy link
Contributor

ps2270 commented Aug 28, 2024

@njr2128
This student project https://cu-mkp.github.io/research-teaching-companion/resources/student-projects/fa21_lin+sundar_danli+anusha_final-project_regimens-remedies/
works fine when linked to from Github, but not from teaching640. Is that because of the + in it? If so, how do we fix it?

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

No branches or pull requests

2 participants