justpy-org / justpy

An object oriented high-level Python Web Framework that requires no frontend programming
https://justpy.io
Apache License 2.0
1.22k stars 96 forks source link

give tutorial examples unique names #468

Closed WolfgangFahl closed 2 years ago

WolfgangFahl commented 2 years ago
scripts/findexamples | grep plot_test
jp.justpy(plot_test1)
jp.justpy(plot_test2)
jp.justpy(plot_test3)
jp.justpy(plot_test4)
jp.justpy(plot_test5)
jp.justpy(plot_test6)
jp.justpy(plot_test7)
jp.justpy(plot_test8)
jp.justpy(plot_test9)
WolfgangFahl commented 2 years ago

and add videos where it makes sense as shown in #464

byzakyz commented 2 years ago

given unique functions names to all functions in tutorial https://github.com/justpy-org/justpy/tree/master/docs/tutorial

WolfgangFahl commented 2 years ago

This seems not to be finished yet. Did you mean "given" or "shall give ..."?

 scripts/findexamples unique
   1 The `jp.justpy(hello_world1)` command starts a web server and sends all requests to the function `hello_world1`.
   4 jp.justpy()
   2 jp.justpy(alert_test)
   2 jp.justpy(bar_example)
   2 jp.justpy(button_counter_demo)
   7 jp.justpy(chart_test)
   3 jp.justpy(comp_test)
   2 jp.justpy(event_demo)
   2 jp.justpy(focus_test)
   4 jp.justpy(for_example)
  19 jp.justpy(grid_test)
   4 jp.justpy(hello_test)
   3 jp.justpy(hello_world)
   2 jp.justpy(input_demo)
   3 jp.justpy(input_demo1)
   3 jp.justpy(input_demo2)
   2 jp.justpy(input_demo3)
   2 jp.justpy(product_app)
   4 jp.justpy(quasar_example)
   2 jp.justpy(rating_test)
   3 jp.justpy(stock_test)
   6 jp.justpy(todo_app)
   2 jp.justpy(tool_tip_demo)
   3 jp.justpy(women_majors)
byzakyz commented 2 years ago

I had only given unique names for the functions in justpy/docs/tutorial, now I also finished renaming in other documents inside justpy/docs . But when I run "scripts/findexamples unique", many of them are not in the results.

byzakyz commented 2 years ago

Sometimes the same function name is used in some other document someplace else, I might have missed those ones.

WolfgangFahl commented 2 years ago

We are making progress. I don't think we need to change the names of handlers if the content hasn't been changed. Changing the names of the entry points should be sufficient.

scripts/findexamples unique
   1 The `jp.justpy(hello_world1)` command starts a web server and sends all requests to the function `hello_world1`.
   4 jp.justpy()
   2 jp.justpy(alert_test)
   2 jp.justpy(bar_example)
   2 jp.justpy(button_counter_demo)
   2 jp.justpy(chart_test3)
   3 jp.justpy(comp_test)
   2 jp.justpy(event_demo)
   2 jp.justpy(focus_test)
   2 jp.justpy(grid_test)
   2 jp.justpy(grid_test16)
   2 jp.justpy(grid_test2)
   2 jp.justpy(grid_test3)
   4 jp.justpy(hello_test)
   3 jp.justpy(hello_world)
   2 jp.justpy(input_demo)
   3 jp.justpy(input_demo1)
   3 jp.justpy(input_demo2)
   2 jp.justpy(input_demo3)
   2 jp.justpy(product_app)
   3 jp.justpy(stock_test)
   6 jp.justpy(todo_app)
docs/blog/reactivity.md
jp.justpy(todo_app)
jp.justpy(todo_app)
jp.justpy(todo_app)
jp.justpy(todo_app)
--
jp.justpy(product_app)
jp.justpy(todo_app)
--
jp.justpy(product_app)
jp.justpy(todo_app)

scripts/findexamples | grep todo_app -B1
WolfgangFahl commented 2 years ago
scripts/findexamples unique
   1 The `jp.justpy(hello_world1)` command starts a web server and sends all requests to the function `hello_world1`.
   4 jp.justpy()
   2 jp.justpy(bar_example)
   2 jp.justpy(chart_test3)
   3 jp.justpy(comp_test)
   2 jp.justpy(event_demo)
   2 jp.justpy(grid_test)
   2 jp.justpy(grid_test2)
   2 jp.justpy(grid_test3)
   4 jp.justpy(hello_test)
   3 jp.justpy(hello_world)
WolfgangFahl commented 2 years ago
scripts/findexamples unique                                     
   1 The `jp.justpy(hello_world1)` command starts a web server and sends all requests to the function `hello_world1`.
   4 jp.justpy()
   3 jp.justpy(comp_test)
   2 jp.justpy(event_demo)
   2 jp.justpy(grid_test)
   2 jp.justpy(grid_test2)
   2 jp.justpy(grid_test3)
   4 jp.justpy(hello_test)
   3 jp.justpy(hello_world)
WolfgangFahl commented 2 years ago

only corner cases left which we might need to handle manually

scripts/findexamples unique                         
   1 The `jp.justpy(hello_world1)` command starts a web server and sends all requests to the function `hello_world1`.
   4 jp.justpy()
byzakyz commented 2 years ago

scripts/extractexamples docs/tutorial/custom_components.md wasn't working for all of the examples in this .md file. I guess scripts/extractexamples finds the examples when jp.justpy() is called. But in some of them justpy was imported as follows:

image image

So I changed it to: image image

there were 4 examples in this md file like this. I don't know if some other examples weren't also extracted because of this.