Giter Site home page Giter Site logo

Deep linking anchors about schemaspy HOT 7 CLOSED

schemaspy avatar schemaspy commented on August 19, 2024
Deep linking anchors

from schemaspy.

Comments (7)

rafalkasa avatar rafalkasa commented on August 19, 2024

Hi @jornh as I understand your proposition is to have possiblity to create anchors links as below on this page https://github.com/adam-p/markdown-here/wiki/Markdown-Here-Cheatsheet#emphasis

Could you prepare some screen shot and explain which section should have such special anchors ?

from schemaspy.

jornh avatar jornh commented on August 19, 2024

Yes, @rafalkasa 😄 exactly as in https://github.com/adam-p/markdown-here/wiki/Markdown-Here-Cheatsheet#emphasis where it opens the page with the linked title scrolled into view.

What triggered the idea in the first place was a need to be able to easily point others to the Relationships section and make sure they see the diagram even for were big tables with a lot of lines in the Columns section. But I'd imagine it would be useful to generalize for all the sections. So this means: On any table page for all the Description, Columns, Indexes and Relationships sections.

Looking a bit more at it today there might also be value in being able to link directly to the "Degrees of separation" tabs under Relationships. As you can see in the screenshot below there is already #oneDegreeImg-chart and #twoDegreeImg-chart fragments used to navigate across the tabs. It's just that it only works for javascript navigation within the page I guess. As you can see a link to http://schemaspy.org/sample/tables/Album.html#twodegreesDegreeImg-chart does not scroll into view and switch to the Two degrees tab as one could imagine it would. But I'll make it up to you if that's worth implementing, hence the question mark on the screen shot below.

chinook database - mozilla firefox

from schemaspy.

jornh avatar jornh commented on August 19, 2024

Just took a quick peek at the sources. (Sorry, couldn't help it)

It turns out id attributes to link to for Columns and Indexes are already there, so these links built by hand already works:

It's just that they are not consistently applied to all of the <h3/> entities, but PR #51 contains a bit of work towards fixing that.

Then with the modification of e.g. https://github.com/schemaspy/schemaspy/blob/v6.0.0-beta.3/src/main/resources/layout/tables/table.html#L100 into

<h3 id="Indexes" class="box-title"><a href="#Indexes">Indexes</a></h3>

there is a functional, but admitted ugly, step towards what I'm asking for. Sorry I'm not very good with the CSS or JS (if that's needed too) to get to the nice link hover effect in https://github.com/adam-p/markdown-here/wiki/Markdown-Here-Cheatsheet#emphasis

Update:
Oh wait. I see you're using Bootstrap for styling and it looks like they themselves now have a similar thing on their documentation pages. It looks like they might be using this plugin: https://www.bryanbraun.com/anchorjs/#basic-hover ... so maybe that's an easy option

from schemaspy.

rafalkasa avatar rafalkasa commented on August 19, 2024

@jornh I would like thank you very much for your very detailed explanation what you understand by "Deep linking anchors".

I have made some investigation about AnchorJS and this is what we need to have for linking anchors in SchemeSpy. Your help and propositions are very appreciated. I have plan to finish this "Deep linking anchors" feature during the weekend.

from schemaspy.

rafalkasa avatar rafalkasa commented on August 19, 2024

Haha it was simpler than I thought so it's ready. Enjoy !

from schemaspy.

jornh avatar jornh commented on August 19, 2024

@rafalkasa thank you very much 🎉 for a super quick implementation of this. It's already put in to good use on a re-run on the first database here.

from schemaspy.

rafalkasa avatar rafalkasa commented on August 19, 2024

It's good to know that such small enhancement make you happy :-) Your future ideas are very appreciated

from schemaspy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.