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

PRE-WIP: ways to link to a section in the manual via [pdcontrol] #191

Open
Lucarda opened this issue Mar 28, 2024 · 10 comments
Open

PRE-WIP: ways to link to a section in the manual via [pdcontrol] #191

Lucarda opened this issue Mar 28, 2024 · 10 comments

Comments

@Lucarda
Copy link
Collaborator

Lucarda commented Mar 28, 2024

as seen in pure-data/pure-data#2231 anchors get ignored when using [pdcontrol].

There is a cross-platform hack to make this happen but:

  • is hard to maintain if we abuse the number sections we want to link from Pd.

  • is a bit ugly in general but is rock solid (if we want the feature, this is it)

it works like:

  • we add a folder with a shortname ala doc/1.manual/pdanchors

  • there we have template.html with this content:

<html>
<head>
  <meta http-equiv="REFRESH" content="0;url=../x2.htm#s2">
</head>
<body>
</body>
</html>
  • we make a copy of the template, then we edit the url= and we save it with a nice-name.html

  • then in Pd we do (from reference folder patches):

[browse ../1.manual/pdanchors/nice-name.html (
|
[pdcontrol]
@porres
Copy link
Collaborator

porres commented Mar 28, 2024

seems nice, I needed it for 2 cases I remember now

@porres
Copy link
Collaborator

porres commented Mar 28, 2024

maybe 3... I know I can find more if this is possible :) 1 case would be enough to grant this. Let's do it

@Lucarda
Copy link
Collaborator Author

Lucarda commented Mar 28, 2024

starting a PR now

@Lucarda
Copy link
Collaborator Author

Lucarda commented Mar 28, 2024

PR done via pure-data/pure-data#2235

@ulioidle
Copy link

It seems like the more robust way to do this would be to just have a version of the manual which is a pd patch, the few images in the manual which are not just screenshots of patches should be able to be worked around easily enough and a script would be able to convert the manual to a patch once the screen shot patches have been converted if they are not still available. I would be willing to put in the time to repatch what needs to be repatched if someone else handles the script.

Or is there something I am missing? Seems too obvious of a solution to not have been done.

@porres
Copy link
Collaborator

porres commented Apr 17, 2024

it's not about referring to a patch in the manual, but referring to bits of text in subsections of the manual

@umlaeute
Copy link

we make a copy of the template, then we edit the url= and we save it with a nice-name.html

alternatively, we could just create the actual redirecting file on-the-fly with [file].

it requires a single abstraction, rather than manually maintained redirect-files.

makeredirect.zip

@Lucarda
Copy link
Collaborator Author

Lucarda commented Apr 17, 2024

very nice but "white space" in path should be handled

file:///C:/Program/%20Files/Pd/doc/1.manual/x2.htm#s2

Your file couldn’t be accessed
It may have been moved, edited, or deleted.
ERR_FILE_NOT_FOUND

EDIT: /%20 should be %20

@ben-wes
Copy link
Contributor

ben-wes commented Apr 17, 2024

it requires a single abstraction, rather than manually maintained redirect-files.

cool!

very nice but "white space" in path should be handled

not sure if that would be @umlaeute's way to go - but here, i added a mechanism to check all chars and replace whitespaces (and remove escaping backslashes). seems to work for me. not sure if other cases would need to be considered, too?

makeredirect_replace_whitespace.zip

EDIT: updated file (removed debugging [print] in patch that i had inserted)
EDIT2: simplified replace-mechanism

@Lucarda
Copy link
Collaborator Author

Lucarda commented Apr 17, 2024

makeredirect_replace_whitespace.zip

works for me on Windows.

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

5 participants