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

PDL::Demos gallery #9

Open
mohawk2 opened this issue Apr 23, 2022 · 13 comments
Open

PDL::Demos gallery #9

mohawk2 opened this issue Apr 23, 2022 · 13 comments

Comments

@mohawk2
Copy link
Member

mohawk2 commented Apr 23, 2022

We should make a section (on the front page - @dhdeangelis fancy making this?) of a "PDL gallery" of demos. This would be a JavaScript query to the MetaCPAN API for all modules starting with PDL::Demos::, which is the namespace where those live. A recent PDL, where those were installed, would list them with the demo command.

A model for this JS exists already, with the "podviewer", and also our search drop-down.

@dhdeangelis
Copy link
Contributor

Good idea, @mohawk2. I will have a look and see what I can do. I am not very proficient in JavaScript but can probe my way forward.

@mohawk2
Copy link
Member Author

mohawk2 commented Apr 23, 2022

Good idea, @mohawk2. I will have a look and see what I can do. I am not very proficient in JavaScript but can probe my way forward.

It's surprisingly easy! Please ask questions if you have them.

Also, the basis of an amazing demo of several modules would be https://scientiaplusconscientia.wordpress.com/2014/08/13/mapping-snowline-temperate-glacier-otsu-optimal-thresholding/ - any chance of creating such? It would show off PDL::NetCDF (a new version is imminent) and probably PDL::Graphics::Simple.

Further thinking about the gallery bit - we could make a convention of demo modules' synopsis showing cpanm (module name), then pdl> demo (demo name), and show the synopsis in the results if that can be easily extracted.

@mohawk2
Copy link
Member Author

mohawk2 commented Apr 23, 2022

By the way, @zmughal - any chance of a PDL demo of Devel::IPerl? That would be powerful!

@dhdeangelis
Copy link
Contributor

dhdeangelis commented May 8, 2022

I start getting a grasp on how this works (not a JQuery master here). For example, adding:

<search-results query="PDL::Demos"></search-results>

to the file index.html within the main content section, after the <app-body> call, gives a list of results placed after the two main paragraphs. A few Some of these results are true PDL::Demos, most some others not, but I guess this can be sorted out somehow.

However, I believe that the page design will probably need to be adapted to make place for this section harmoniously. Is this something that should perhaps be addressed in concert with #15 and #16 ?

@mohawk2
Copy link
Member Author

mohawk2 commented May 8, 2022

However, I believe that the page design will probably need to be adapted to make place for this section harmoniously. Is this something that should perhaps be addressed in concert with #15 and #16 ?

I believe what Joel has in mind is that those issues will make our code, templates, etc easier to maintain / enhance. The page-design you're referring to would be such an enhancement. However, like all technical debt matters, it's a trade-off: do we feel the benefit of ripping out jQuery outweighs the cost of doing so (including the opportunity cost of not doing other things like making/improving a demo gallery)?

More immediately, @dhdeangelis what does <search-results query="PDL::Demos"></search-results> currently produce that it shouldn't? If we can tweak that towards being what it should, I think that would be a big win. It would certainly be worth making a new <demo-gallery> if needed with such tweaks; because we have no-one depending on the structure of our setup, we have freedom to refactor as we see fit when it becomes clearer what's needed.

@dhdeangelis
Copy link
Contributor

More immediately, @dhdeangelis what does <search-results query="PDL::Demos"></search-results> currently produce that it shouldn't? If we can tweak that towards being what it should, I think that would be a big win. It would certainly be worth making a new <demo-gallery> if needed with such tweaks; because we have no-one depending on the structure of our setup, we have freedom to refactor as we see fit when it becomes clearer what's needed.

Sure, below is what the line produces:

Search provided by MetaCPAN

Found 21 hits

PDL::Demos - PDL demo infrastructure

PDL::Demos::PGPLOT - demonstrate PDL::Graphics::PGPLOT capabilities

PDL::Demos::Gnuplot - demonstrate PDL::Graphics::Gnuplot capabilities

PDL::Demos::PGPLOT_OO - demonstrate PDL::Graphics::PGPLOT OO capabilities

PDL::Demos::General -

PDL::Demos::Transform_demo -

PDL::Demos::BAD_demo -

PDL::Demos::TriD1 -

PDL::Demos::TriD2 -

PDL::Demos::TriDGallery -

PDL::Demos::Cartography_demo -

PDL::FAQ - Frequently asked questions about PDL

perldl - Simple shell for PDL (see also pdl2)

PDL::Tips - Small tidbits of useful arcana. Programming tidbits and such.

PDL::Transform::Cartography - Useful cartographic projections

WebService::Plotly - access plot.ly programmatically

PDL::Graphics - Introduction to the PDL::Graphics modules

PDL::BadValues - Discussion of bad value support in PDL

PDL::QuickStart - Quick introduction to PDL features.

PDL::Graphics::TriD::GObject - Simple Graph Objects for TriD

@mohawk2
Copy link
Member Author

mohawk2 commented May 9, 2022

Sounds like what we'd need here, then, is an additional attribute on <search-results> of prefix=, here to be PDL::Demos::. I suspect the MetaCPAN API doesn't support such a concept, so we'd need to filter it in our JS?

@dhdeangelis
Copy link
Contributor

The MetaCPAN API is very nice and flexible but I do not see a way there to restrict and filter results.

For example Searching for <search-results query="PDL::Demos::Gnuplot"></search-results> returns:

Search provided by MetaCPAN

Found 2 hits

PDL::Demos::Gnuplot - demonstrate PDL::Graphics::Gnuplot capabilities

PDL::Graphics - Introduction to the PDL::Graphics modules

@mohawk2
Copy link
Member Author

mohawk2 commented May 10, 2022

The search-results pseudo-element is implemented in JavaScript on our site. I am proposing that by adding a prefix attribute to that, we could achieve what we want.

@dhdeangelis
Copy link
Contributor

I just implemented a simple Demo gallery that works OK but looks ugly:
https://github.com/dhdeangelis/pdlporters.github.com/tree/hda
I could not make a GitHub page out of this. How should we preview this before doing a PR?

@mohawk2
Copy link
Member Author

mohawk2 commented May 15, 2022

How about making another link in the left bar for "PDL Demos gallery (experimental)"? That would allow us to release early, release often :-)

Also, the work looks really promising! Is it possible to just add an optional prefix attribute to the existing search-results, rather than duplicating it?

@dhdeangelis
Copy link
Contributor

dhdeangelis commented May 16, 2022

How about making another link in the left bar for "PDL Demos gallery (experimental)"? That would allow us to release early, release often :-)

Good idea.

Also, the work looks really promising! Is it possible to just add an optional prefix attribute to the existing search-results, rather than duplicating it?

I am not sure. It is not exactly a duplicate. Will have a look.

@mohawk2
Copy link
Member Author

mohawk2 commented May 17, 2022

Thank you!

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