DjangoGirls / tutorial

This is a tutorial we are using for Django Girls workshops
http://tutorial.djangogirls.org/
Other
1.53k stars 1.86k forks source link

Need fixing deprecated methods in GitBook #1727

Closed nikhiljohn10 closed 3 years ago

nikhiljohn10 commented 3 years ago

Properties deprecated

As it is found inside the log of gitbook serve, there are a few warnings found. Is there a particular reason why these are not yet fixed?

Here are the list of properties to fix:

~ % gitbook serve
Live reload server started on port: 35729
Press CTRL+C to quit ...

info: parsing multilingual book, with 1 languages 
info: 16 plugins are installed 
info: loading plugin "heading-anchors"... OK 
info: loading plugin "ga"... OK 
info: loading plugin "richquotes"... OK 
info: loading plugin "github"... OK 
info: loading plugin "language-picker"... OK 
info: loading plugin "sidebar-ad"... OK 
info: loading plugin "codeblock-label"... OK 
info: loading plugin "sectionx-ex"... OK 
info: loading plugin "collapsible-menu"... OK 
info: loading plugin "livereload"... OK 
info: loading plugin "highlight"... OK 
info: loading plugin "search"... OK 
info: loading plugin "lunr"... OK 
info: loading plugin "sharing"... OK 
info: loading plugin "fontsettings"... OK 
info: loading plugin "theme-default"... OK 
info: found 1513 asset files 
warn: "options" property is deprecated, use config.get(key) instead 
info:  
info: generating language "en" 
info: found 26 pages 
info: found 57 asset files 
warn: "sections" property is deprecated, use page.content instead 
warn: "this.generator" property is deprecated, use "this.output.name" instead 
warn: "navigation" property is deprecated 
warn: "book" property is deprecated, use "this" directly instead 
info: >> generation finished with success in 9.4s ! 

Starting server ...
Serving book on http://localhost:4000
magul commented 3 years ago

@nikhiljohn10 As we agreed yesterday (also with @das-g ) we abandoned GitBook in favour of honkit, so probably instead of

gitbook serve

documentation should mention

honkit serve

(additional point here would be to not install honkit globally, and use npx to run that command from locally exising node_modules/)

nikhiljohn10 commented 3 years ago

@nikhiljohn10 As we agreed yesterday (also with @das-g ) we abandoned GitBook in favour of honkit, so probably instead of

Oh, I see. I thought it was the same thing and there are gitbook name references everywhere in the repo. It was confusing. But now everything is clear. I'll re-research it again and get back you to regarding all the above. I'll close the issue myself if it is not deprecated in honkit. Thank you very much, @magul.

nikhiljohn10 commented 3 years ago

As I have noted in the first comment, there are the same 5 deprecated properties in honkit as well.

~ % npm install 
added 345 packages from 355 contributors and audited 345 packages in 6.36s
( 16 vulnerabilities projected while 'npm install'. 5 of them are fixable by 'npm audit fix' )
~ % npx honkit serve
Live reload server started on port: 35729
Press CTRL+C to quit ...

Starting server ...
info: parsing multilingual book, with 1 languages 
info: 15 plugins are installed 
info: 15 explicitly listed 
info: plugin "heading-anchors" is loaded
info: plugin "ga" is loaded
info: plugin "richquotes" is loaded
info: plugin "github" is loaded
info: plugin "language-picker" is loaded
info: plugin "sidebar-ad" is loaded
info: plugin "codeblock-label" is loaded
info: plugin "sectionx-ex" is loaded
info: plugin "collapsible-menu" is loaded
info: plugin "livereload" is loaded
info: plugin "highlight" is loaded
info: plugin "search" is loaded
info: plugin "lunr" is loaded
info: plugin "fontsettings" is loaded
info: plugin "theme-default" is loaded
info: found 1512 asset files 
warn: "options" property is deprecated, use config.get(key) instead 
warn: assets folder for plugin "ga" doesn't exist 
info:  
info: generating language "en" 
info: found 26 pages 
info: found 57 asset files 
warn: "this.generator" property is deprecated, use "this.output.name" instead 
warn: "navigation" property is deprecated 
warn: "book" property is deprecated, use "this" directly instead 
warn: "sections" property is deprecated, use page.content instead 
info: >> generation finished with success in 8.3s ! 
Serving book on http://localhost:4000
das-g commented 3 years ago

As it is found inside the log of gitbook serve, there are a few warnings found. Is there a particular reason why these are not yet fixed?

Not that I know of. Pull requests welcome!

nikhiljohn10 commented 3 years ago

Causes

  1. gitbook-plugin-heading-anchors 1.0.3
    • Deprications: options
    • Anchor JS used is version 1.2.1. But the latest version is 4.3.1.
    • Fix: Fork it and fix it.
  2. gitbook-plugin-richquotes 0.0.9
    • Deprications: options & sections
    • Fix: Updated to new version
nikhiljohn10 commented 3 years ago

Conclusion

By debugging honkit, found the following result on instances of each deprecated property usage.

  options:  327
  navigation:  321
  generator:  321
  book:  321
  sections:  142

Even with node modules, not all of them are found by advanced file searches.

More importantly, this has nothing to do with DjangoGirl's code. It should be fixed by Honkit maintainers. But it is possible to use the updated version of plugins as time pass if that is a possibility.