[docs] question about deprecation badges
Hi all, I'm currently hacking on the deprecation badges in openstack-manuals, and there's a couple of things I don't understand. Any chance someone could explain why www/latest/badge.html doesn't just do: {% include 'templates/deprecated_badge.tmpl' %} like all the others? https://github.com/openstack/openstack-manuals/commit/961f544a4ec383d8b500af... I'm also what exactly would be wrong with the included CSS path if CSSDIR was used in www/templates/deprecated_badge.tmpl instead of heeding this caveat: https://github.com/openstack/openstack-manuals/commit/961f544a4ec383d8b500af... It would be good to fix it to use CSSDIR because currently it's awkward to test CSS changes. Thanks! Adam
Hi Adam, that approach is followed in order to be consumed from other projects like theme docs, using an ajax call doing a get and including its content dynamically on the page, also the css dir its not used bc otherwise it will not point to the rite css path on the fore-mentioned approach, instead its using the absolute path in order to load the css correctly through the ajax call ( check https://review.openstack.org/#/c/585516/) on docs theme the deprecation badge is loaded using this snippet <script type="text/javascript"> $(document).ready(function(){ $.ajax({ context: this, dataType : "html", url : "https://docs.openstack.org/{{ series }}/badge.html", success : function(results) { $('#deprecated-badge-container').html(results); } }); }); </script> on file openstackdocstheme/theme/openstackdocs/layout.html hope that shed some lite , have in mind that its a first iteration and any better approach its welcome regards El vie., 4 ene. 2019 a las 20:45, Adam Spiers (<aspiers@suse.com>) escribió:
Hi all,
I'm currently hacking on the deprecation badges in openstack-manuals, and there's a couple of things I don't understand. Any chance someone could explain why www/latest/badge.html doesn't just do:
{% include 'templates/deprecated_badge.tmpl' %}
like all the others?
https://github.com/openstack/openstack-manuals/commit/961f544a4ec383d8b500af...
I'm also what exactly would be wrong with the included CSS path if CSSDIR was used in www/templates/deprecated_badge.tmpl instead of heeding this caveat:
https://github.com/openstack/openstack-manuals/commit/961f544a4ec383d8b500af...
It would be good to fix it to use CSSDIR because currently it's awkward to test CSS changes.
Thanks! Adam
-- Sebastian Marcet https://ar.linkedin.com/in/smarcet SKYPE: sebastian.marcet
and the latest release its different bc its a corner case, there is not way to figure it out from the template logic if current navigated release its the latest so that is why its has its own template and logic regards El sáb., 5 ene. 2019 a las 1:19, Sebastian Marcet (<smarcet@gmail.com>) escribió:
Hi Adam, that approach is followed in order to be consumed from other projects like theme docs, using an ajax call doing a get and including its content dynamically on the page, also the css dir its not used bc otherwise it will not point to the rite css path on the fore-mentioned approach, instead its using the absolute path in order to load the css correctly through the ajax call ( check https://review.openstack.org/#/c/585516/)
on docs theme the deprecation badge is loaded using this snippet
<script type="text/javascript"> $(document).ready(function(){
$.ajax({ context: this, dataType : "html", url : "https://docs.openstack.org/{{ series }}/badge.html", success : function(results) { $('#deprecated-badge-container').html(results); } }); }); </script>
on file openstackdocstheme/theme/openstackdocs/layout.html
hope that shed some lite , have in mind that its a first iteration and any better approach its welcome
regards
El vie., 4 ene. 2019 a las 20:45, Adam Spiers (<aspiers@suse.com>) escribió:
Hi all,
I'm currently hacking on the deprecation badges in openstack-manuals, and there's a couple of things I don't understand. Any chance someone could explain why www/latest/badge.html doesn't just do:
{% include 'templates/deprecated_badge.tmpl' %}
like all the others?
https://github.com/openstack/openstack-manuals/commit/961f544a4ec383d8b500af...
I'm also what exactly would be wrong with the included CSS path if CSSDIR was used in www/templates/deprecated_badge.tmpl instead of heeding this caveat:
https://github.com/openstack/openstack-manuals/commit/961f544a4ec383d8b500af...
It would be good to fix it to use CSSDIR because currently it's awkward to test CSS changes.
Thanks! Adam
-- Sebastian Marcet https://ar.linkedin.com/in/smarcet SKYPE: sebastian.marcet
-- Sebastian Marcet https://ar.linkedin.com/in/smarcet SKYPE: sebastian.marcet
you could check the reason here https://review.openstack.org/#/c/585517/ https://review.openstack.org/#/c/585517/1/openstackdocstheme/theme/openstack... regards El sáb., 5 ene. 2019 a las 1:34, Sebastian Marcet (<smarcet@gmail.com>) escribió:
and the latest release its different bc its a corner case, there is not way to figure it out from the template logic if current navigated release its the latest so that is why its has its own template and logic regards
El sáb., 5 ene. 2019 a las 1:19, Sebastian Marcet (<smarcet@gmail.com>) escribió:
Hi Adam, that approach is followed in order to be consumed from other projects like theme docs, using an ajax call doing a get and including its content dynamically on the page, also the css dir its not used bc otherwise it will not point to the rite css path on the fore-mentioned approach, instead its using the absolute path in order to load the css correctly through the ajax call ( check https://review.openstack.org/#/c/585516/)
on docs theme the deprecation badge is loaded using this snippet
<script type="text/javascript"> $(document).ready(function(){
$.ajax({ context: this, dataType : "html", url : "https://docs.openstack.org/{{ series }}/badge.html", success : function(results) { $('#deprecated-badge-container').html(results); } }); }); </script>
on file openstackdocstheme/theme/openstackdocs/layout.html
hope that shed some lite , have in mind that its a first iteration and any better approach its welcome
regards
El vie., 4 ene. 2019 a las 20:45, Adam Spiers (<aspiers@suse.com>) escribió:
Hi all,
I'm currently hacking on the deprecation badges in openstack-manuals, and there's a couple of things I don't understand. Any chance someone could explain why www/latest/badge.html doesn't just do:
{% include 'templates/deprecated_badge.tmpl' %}
like all the others?
https://github.com/openstack/openstack-manuals/commit/961f544a4ec383d8b500af...
I'm also what exactly would be wrong with the included CSS path if CSSDIR was used in www/templates/deprecated_badge.tmpl instead of heeding this caveat:
https://github.com/openstack/openstack-manuals/commit/961f544a4ec383d8b500af...
It would be good to fix it to use CSSDIR because currently it's awkward to test CSS changes.
Thanks! Adam
-- Sebastian Marcet https://ar.linkedin.com/in/smarcet SKYPE: sebastian.marcet
-- Sebastian Marcet https://ar.linkedin.com/in/smarcet SKYPE: sebastian.marcet
-- Sebastian Marcet https://ar.linkedin.com/in/smarcet SKYPE: sebastian.marcet
participants (2)
-
Adam Spiers
-
Sebastian Marcet