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

Permalinks #9

Open
billstclair opened this issue Apr 10, 2017 · 1 comment
Open

Permalinks #9

billstclair opened this issue Apr 10, 2017 · 1 comment

Comments

@billstclair
Copy link
Owner

Web browsers have a bad habit of going to the server whenever anything but a hash changes (example.com#hash). Hashes are interpreted as scrolling to an anchor tag with a matching name:

<a name='hash'>...</a>

In Elm, we've got to keep the same base URL, and search string, or the server will restart our code, which makes for a startup transient, especially if the caches aren't fresh. So I'll address pages with just hash changes:

https://Xossbow.com#about

And, in order to ALSO use the browser's name scrolling feature, the hashes can have an additional dotted component:

https://Xossbow.com#docs.Settings

This will require another Markdown extension to automatically generate named links for headings, and to be able to specify your own named links, with a way for user-code to add a wrapper around the tags that are automatically generated, so that Xossbow can change the output for:

*** Settings

Which would normally generate:

["a",{"name":"Settings"},
  ["h3",{},
    ["Settings"]
  ]
]

to:

["a",{"name":"docs.Settings"},
  ["h3",{},
    ["Settings"]
  ]
]
@billstclair billstclair mentioned this issue Apr 12, 2017
@billstclair
Copy link
Owner Author

I fixed the basic part of this in 6a2c31c. Still need to do the names.

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

1 participant