cu-mkp / research-teaching-companion

Webpage content and navigation for the Making and Knowing Project's Research and Teaching Companion
https://teaching640.makingandknowing.org/
1 stars 0 forks source link

Syntax for links #122

Open njr2128 opened 5 months ago

njr2128 commented 5 months ago

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

njr2128 commented 5 months ago

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

ps2270 commented 5 months ago

according to naming protocols, shouldn't it be "activitysheet", not "activity-sheets" in the sample syntax you provided?

On Mon, Jul 1, 2024 at 12:54 PM Naomi Rosenkranz @.***> wrote:

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

— Reply to this email directly, view it on GitHub https://github.com/cu-mkp/research-teaching-companion/issues/122#issuecomment-2200624060, or unsubscribe https://github.com/notifications/unsubscribe-auth/AF75UYFWRX37KGJWXZQN7RDZKGCT7AVCNFSM6AAAAABKF6FVZGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMBQGYZDIMBWGA . You are receiving this because you were assigned.Message ID: @.***>

ps2270 commented 5 months ago

sorry, never mind! I misspoke.

On Mon, Jul 1, 2024 at 2:40 PM Pamela H. Smith @.***> wrote:

according to naming protocols, shouldn't it be "activitysheet", not "activity-sheets" in the sample syntax you provided?

On Mon, Jul 1, 2024 at 12:54 PM Naomi Rosenkranz @.***> wrote:

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

— Reply to this email directly, view it on GitHub https://github.com/cu-mkp/research-teaching-companion/issues/122#issuecomment-2200624060, or unsubscribe https://github.com/notifications/unsubscribe-auth/AF75UYFWRX37KGJWXZQN7RDZKGCT7AVCNFSM6AAAAABKF6FVZGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMBQGYZDIMBWGA . You are receiving this because you were assigned.Message ID: @.***>

ps2270 commented 4 months ago

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 commented 4 months ago

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 commented 4 months ago

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 commented 4 months ago

fix missing space between ref and < image

njr2128 commented 4 months ago

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 commented 4 months ago

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 commented 4 months ago

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

njr2128 commented 4 months ago

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 commented 4 months ago

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 commented 4 months ago

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

image

njr2128 commented 4 months ago

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

njr2128 commented 4 months ago

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

njr2128 commented 4 months ago

@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 https://github.com/cu-mkp/research-teaching-companion/commit/c6b7a87d5a837bfb5256e787a42871624b8818ee where there is /static/documents/ instead of /documents/

Another example is missing a leading slash as here: https://github.com/cu-mkp/research-teaching-companion/commit/cdb7d032f0eb32b141a13c502566258d7ccb5447

Another: inclusion of /content/resources instead of /resources/ https://github.com/cu-mkp/research-teaching-companion/commit/16fdd011d1c48b3f55bd47d08aa0e58f0c61893e

Another is missing training slashes https://github.com/cu-mkp/research-teaching-companion/commit/029ff76dc6f3ab4675ea120978f2fc762e551445 and https://github.com/cu-mkp/research-teaching-companion/commit/49261f56a221c32462e50c7bbd6dbd81b5701769

missing trailing slashes and missing /resources/activity-sheets/ https://github.com/cu-mkp/research-teaching-companion/commit/1b3fbc441d43c1ada1ceaa9f0e5cf5c4af73da1a and https://github.com/cu-mkp/research-teaching-companion/commit/811cd16f4e2dc8e38cf8f153f5bd26f31fc8a39e

njr2128 commented 4 months ago

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 commented 4 months ago

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 commented 4 months ago

It seems that + in file names are problematic. For example, this page (https://teaching640.makingandknowing.org/documents/pdf/su22_fld_cunningham_annika_onion-skin-dyeing-template+notes.pdf) still does not load when linked from https://teaching640.makingandknowing.org/resources/student-projects/su22_fld_cunningham_annika_onion-skin-dyeing/

njr2128 commented 3 months ago

@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>disability@columbia.edu</u>](mailto:disability@columbia.edu).
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 commented 3 months ago

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

njr2128 commented 3 months ago

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

njr2128 commented 3 months ago

NEXT:

ps2270 commented 3 months ago

@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)

njr2128 commented 3 months ago

@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 commented 3 months ago

@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?