updated book and template with features

This commit is contained in:
Maccesch 2024-08-24 22:50:02 +01:00
parent 55f5ff9557
commit 1ba0b03965
76 changed files with 79 additions and 79 deletions

View file

@ -1,3 +1,3 @@
# use_interval # use_interval
<!-- cmdrun python3 ../extract_doc_comment.py use_interval --> <!-- cmdrun python3 ../extract_doc_comment.py use_interval use_interval -->

View file

@ -1,3 +1,3 @@
# use_interval_fn # use_interval_fn
<!-- cmdrun python3 ../extract_doc_comment.py use_interval_fn --> <!-- cmdrun python3 ../extract_doc_comment.py use_interval_fn use_interval_fn -->

View file

@ -1,3 +1,3 @@
# use_raf_fn # use_raf_fn
<!-- cmdrun python3 ../extract_doc_comment.py use_raf_fn --> <!-- cmdrun python3 ../extract_doc_comment.py use_raf_fn use_raf_fn -->

View file

@ -1,3 +1,3 @@
# use_timeout_fn # use_timeout_fn
<!-- cmdrun python3 ../extract_doc_comment.py use_timeout_fn --> <!-- cmdrun python3 ../extract_doc_comment.py use_timeout_fn use_timeout_fn -->

View file

@ -1,3 +1,3 @@
# use_timestamp # use_timestamp
<!-- cmdrun python3 ../extract_doc_comment.py use_timestamp --> <!-- cmdrun python3 ../extract_doc_comment.py use_timestamp use_timestamp -->

View file

@ -1,3 +1,3 @@
# use_breakpoints # use_breakpoints
<!-- cmdrun python3 ../extract_doc_comment.py use_breakpoints --> <!-- cmdrun python3 ../extract_doc_comment.py use_breakpoints use_breakpoints -->

View file

@ -1,3 +1,3 @@
# use_broadcast_channel # use_broadcast_channel
<!-- cmdrun python3 ../extract_doc_comment.py use_broadcast_channel --> <!-- cmdrun python3 ../extract_doc_comment.py use_broadcast_channel use_broadcast_channel -->

View file

@ -1,3 +1,3 @@
# use_clipboard # use_clipboard
<!-- cmdrun python3 ../extract_doc_comment.py use_clipboard --> <!-- cmdrun python3 ../extract_doc_comment.py use_clipboard use_clipboard -->

View file

@ -1,3 +1,3 @@
# use_color_mode # use_color_mode
<!-- cmdrun python3 ../extract_doc_comment.py use_color_mode --> <!-- cmdrun python3 ../extract_doc_comment.py use_color_mode use_color_mode -->

View file

@ -1,3 +1,3 @@
# use_cookie # use_cookie
<!-- cmdrun python3 ../extract_doc_comment.py use_cookie --> <!-- cmdrun python3 ../extract_doc_comment.py use_cookie use_cookie -->

View file

@ -1,3 +1,3 @@
# use_css_var # use_css_var
<!-- cmdrun python3 ../extract_doc_comment.py use_css_var --> <!-- cmdrun python3 ../extract_doc_comment.py use_css_var use_css_var -->

View file

@ -1,3 +1,3 @@
# use_display_media # use_display_media
<!-- cmdrun python3 ../extract_doc_comment.py use_display_media --> <!-- cmdrun python3 ../extract_doc_comment.py use_display_media use_display_media -->

View file

@ -1,3 +1,3 @@
# use_event_listener # use_event_listener
<!-- cmdrun python3 ../extract_doc_comment.py use_event_listener --> <!-- cmdrun python3 ../extract_doc_comment.py use_event_listener use_event_listener -->

View file

@ -1,3 +1,3 @@
# use_favicon # use_favicon
<!-- cmdrun python3 ../extract_doc_comment.py use_favicon --> <!-- cmdrun python3 ../extract_doc_comment.py use_favicon use_favicon -->

View file

@ -1,3 +1,3 @@
# use_media_query # use_media_query
<!-- cmdrun python3 ../extract_doc_comment.py use_media_query --> <!-- cmdrun python3 ../extract_doc_comment.py use_media_query use_media_query -->

View file

@ -1,3 +1,3 @@
# use_permission # use_permission
<!-- cmdrun python3 ../extract_doc_comment.py use_permission --> <!-- cmdrun python3 ../extract_doc_comment.py use_permission use_permission -->

View file

@ -1,3 +1,3 @@
# use_preferred_contrast # use_preferred_contrast
<!-- cmdrun python3 ../extract_doc_comment.py use_preferred_contrast --> <!-- cmdrun python3 ../extract_doc_comment.py use_preferred_contrast use_preferred_contrast -->

View file

@ -1,3 +1,3 @@
# use_preferred_dark # use_preferred_dark
<!-- cmdrun python3 ../extract_doc_comment.py use_preferred_dark --> <!-- cmdrun python3 ../extract_doc_comment.py use_preferred_dark use_preferred_dark -->

View file

@ -1,3 +1,3 @@
# use_prefers_reduced_motion # use_prefers_reduced_motion
<!-- cmdrun python3 ../extract_doc_comment.py use_prefers_reduced_motion --> <!-- cmdrun python3 ../extract_doc_comment.py use_prefers_reduced_motion use_prefers_reduced_motion -->

View file

@ -1,3 +1,3 @@
# use_service_worker # use_service_worker
<!-- cmdrun python3 ../extract_doc_comment.py use_service_worker --> <!-- cmdrun python3 ../extract_doc_comment.py use_service_worker use_service_worker -->

View file

@ -1,3 +1,3 @@
# use_user_media # use_user_media
<!-- cmdrun python3 ../extract_doc_comment.py use_user_media --> <!-- cmdrun python3 ../extract_doc_comment.py use_user_media use_user_media -->

View file

@ -1,3 +1,3 @@
# use_web_notification # use_web_notification
<!-- cmdrun python3 ../extract_doc_comment.py use_web_notification --> <!-- cmdrun python3 ../extract_doc_comment.py use_web_notification use_web_notification -->

View file

@ -1,3 +1,3 @@
# use_active_element # use_active_element
<!-- cmdrun python3 ../extract_doc_comment.py use_active_element --> <!-- cmdrun python3 ../extract_doc_comment.py use_active_element use_active_element -->

View file

@ -1,3 +1,3 @@
# use_document # use_document
<!-- cmdrun python3 ../extract_doc_comment.py use_document --> <!-- cmdrun python3 ../extract_doc_comment.py use_document use_document -->

View file

@ -1,3 +1,3 @@
# use_document_visibility # use_document_visibility
<!-- cmdrun python3 ../extract_doc_comment.py use_document_visibility --> <!-- cmdrun python3 ../extract_doc_comment.py use_document_visibility use_document_visibility -->

View file

@ -1,3 +1,3 @@
# use_draggable # use_draggable
<!-- cmdrun python3 ../extract_doc_comment.py use_draggable --> <!-- cmdrun python3 ../extract_doc_comment.py use_draggable use_draggable -->

View file

@ -1,3 +1,3 @@
# use_drop_zone # use_drop_zone
<!-- cmdrun python3 ../extract_doc_comment.py use_drop_zone --> <!-- cmdrun python3 ../extract_doc_comment.py use_drop_zone use_drop_zone -->

View file

@ -1,3 +1,3 @@
# use_element_bounding # use_element_bounding
<!-- cmdrun python3 ../extract_doc_comment.py use_element_bounding --> <!-- cmdrun python3 ../extract_doc_comment.py use_element_bounding use_element_bounding -->

View file

@ -1,3 +1,3 @@
# use_element_size # use_element_size
<!-- cmdrun python3 ../extract_doc_comment.py use_element_size --> <!-- cmdrun python3 ../extract_doc_comment.py use_element_size use_element_size -->

View file

@ -1,3 +1,3 @@
# use_element_visibility # use_element_visibility
<!-- cmdrun python3 ../extract_doc_comment.py use_element_visibility --> <!-- cmdrun python3 ../extract_doc_comment.py use_element_visibility use_element_visibility -->

View file

@ -1,3 +1,3 @@
# use_intersection_observer # use_intersection_observer
<!-- cmdrun python3 ../extract_doc_comment.py use_intersection_observer --> <!-- cmdrun python3 ../extract_doc_comment.py use_intersection_observer use_intersection_observer -->

View file

@ -1,3 +1,3 @@
# use_mouse_in_element # use_mouse_in_element
<!-- cmdrun python3 ../extract_doc_comment.py use_mouse_in_element --> <!-- cmdrun python3 ../extract_doc_comment.py use_mouse_in_element use_mouse_in_element -->

View file

@ -1,3 +1,3 @@
# use_mutation_observer # use_mutation_observer
<!-- cmdrun python3 ../extract_doc_comment.py use_mutation_observer --> <!-- cmdrun python3 ../extract_doc_comment.py use_mutation_observer use_mutation_observer -->

View file

@ -1,3 +1,3 @@
# use_resize_observer # use_resize_observer
<!-- cmdrun python3 ../extract_doc_comment.py use_resize_observer --> <!-- cmdrun python3 ../extract_doc_comment.py use_resize_observer use_resize_observer -->

View file

@ -1,3 +1,3 @@
# use_window # use_window
<!-- cmdrun python3 ../extract_doc_comment.py use_window --> <!-- cmdrun python3 ../extract_doc_comment.py use_window use_window -->

View file

@ -1,3 +1,3 @@
# use_window_focus # use_window_focus
<!-- cmdrun python3 ../extract_doc_comment.py use_window_focus --> <!-- cmdrun python3 ../extract_doc_comment.py use_window_focus use_window_focus -->

View file

@ -1,3 +1,3 @@
# use_window_scroll # use_window_scroll
<!-- cmdrun python3 ../extract_doc_comment.py use_window_scroll --> <!-- cmdrun python3 ../extract_doc_comment.py use_window_scroll use_window_scroll -->

View file

@ -1,3 +1,3 @@
# use_intl_number_format # use_intl_number_format
<!-- cmdrun python3 ../extract_doc_comment.py use_intl_number_format --> <!-- cmdrun python3 ../extract_doc_comment.py use_intl_number_format use_intl_number_format -->

View file

@ -1,3 +1,3 @@
# use_locale # use_locale
<!-- cmdrun python3 ../extract_doc_comment.py use_locale --> <!-- cmdrun python3 ../extract_doc_comment.py use_locale use_locale -->

View file

@ -1,3 +1,3 @@
# use_locales # use_locales
<!-- cmdrun python3 ../extract_doc_comment.py use_locales --> <!-- cmdrun python3 ../extract_doc_comment.py use_locales use_locales -->

View file

@ -1,3 +1,3 @@
# use_sorted # use_sorted
<!-- cmdrun python3 ../extract_doc_comment.py use_sorted --> <!-- cmdrun python3 ../extract_doc_comment.py use_sorted use_sorted -->

View file

@ -1,3 +1,3 @@
# use_event_source # use_event_source
<!-- cmdrun python3 ../extract_doc_comment.py use_event_source --> <!-- cmdrun python3 ../extract_doc_comment.py use_event_source use_event_source -->

View file

@ -1,3 +1,3 @@
# use_websocket # use_websocket
<!-- cmdrun python3 ../extract_doc_comment.py use_websocket --> <!-- cmdrun python3 ../extract_doc_comment.py use_websocket use_websocket -->

View file

@ -1,3 +1,3 @@
# signal_debounced # signal_debounced
<!-- cmdrun python3 ../extract_doc_comment.py signal_debounced --> <!-- cmdrun python3 ../extract_doc_comment.py signal_debounced signal_debounced -->

View file

@ -1,3 +1,3 @@
# signal_throttled # signal_throttled
<!-- cmdrun python3 ../extract_doc_comment.py signal_throttled --> <!-- cmdrun python3 ../extract_doc_comment.py signal_throttled signal_throttled -->

View file

@ -1,3 +1,3 @@
# sync_signal # sync_signal
<!-- cmdrun python3 ../extract_doc_comment.py sync_signal --> <!-- cmdrun python3 ../extract_doc_comment.py sync_signal sync_signal -->

View file

@ -1,3 +1,3 @@
# on_click_outside # on_click_outside
<!-- cmdrun python3 ../extract_doc_comment.py on_click_outside --> <!-- cmdrun python3 ../extract_doc_comment.py on_click_outside on_click_outside -->

View file

@ -1,3 +1,3 @@
# use_device_orientation # use_device_orientation
<!-- cmdrun python3 ../extract_doc_comment.py use_device_orientation --> <!-- cmdrun python3 ../extract_doc_comment.py use_device_orientation use_device_orientation -->

View file

@ -1,3 +1,3 @@
# use_device_pixel_ratio # use_device_pixel_ratio
<!-- cmdrun python3 ../extract_doc_comment.py use_device_pixel_ratio --> <!-- cmdrun python3 ../extract_doc_comment.py use_device_pixel_ratio use_device_pixel_ratio -->

View file

@ -1,3 +1,3 @@
# use_element_hover # use_element_hover
<!-- cmdrun python3 ../extract_doc_comment.py use_element_hover --> <!-- cmdrun python3 ../extract_doc_comment.py use_element_hover use_element_hover -->

View file

@ -1,3 +1,3 @@
# use_geolocation # use_geolocation
<!-- cmdrun python3 ../extract_doc_comment.py use_geolocation --> <!-- cmdrun python3 ../extract_doc_comment.py use_geolocation use_geolocation -->

View file

@ -1,3 +1,3 @@
# use_idle # use_idle
<!-- cmdrun python3 ../extract_doc_comment.py use_idle --> <!-- cmdrun python3 ../extract_doc_comment.py use_idle use_idle -->

View file

@ -1,3 +1,3 @@
# use_infinite_scroll # use_infinite_scroll
<!-- cmdrun python3 ../extract_doc_comment.py use_infinite_scroll --> <!-- cmdrun python3 ../extract_doc_comment.py use_infinite_scroll use_infinite_scroll -->

View file

@ -1,3 +1,3 @@
# use_mouse # use_mouse
<!-- cmdrun python3 ../extract_doc_comment.py use_mouse --> <!-- cmdrun python3 ../extract_doc_comment.py use_mouse use_mouse -->

View file

@ -1,3 +1,3 @@
# use_scroll # use_scroll
<!-- cmdrun python3 ../extract_doc_comment.py use_scroll --> <!-- cmdrun python3 ../extract_doc_comment.py use_scroll use_scroll -->

View file

@ -1,3 +1,3 @@
# use_local_storage # use_local_storage
<!-- cmdrun python3 ../extract_doc_comment.py storage/use_local_storage --> <!-- cmdrun python3 ../extract_doc_comment.py storage/use_local_storage storage -->

View file

@ -1,3 +1,3 @@
# use_session_storage # use_session_storage
<!-- cmdrun python3 ../extract_doc_comment.py storage/use_session_storage --> <!-- cmdrun python3 ../extract_doc_comment.py storage/use_session_storage storage -->

View file

@ -1,3 +1,3 @@
# use_storage # use_storage
<!-- cmdrun python3 ../extract_doc_comment.py storage/use_storage --> <!-- cmdrun python3 ../extract_doc_comment.py storage/use_storage storage -->

View file

@ -1,3 +1,3 @@
# header # header
<!-- cmdrun python3 ../extract_doc_comment.py utils/header --> <!-- cmdrun python3 ../extract_doc_comment.py utils/header utils/header -->

View file

@ -1,3 +1,3 @@
# is_err # is_err
<!-- cmdrun python3 ../extract_doc_comment.py is_err --> <!-- cmdrun python3 ../extract_doc_comment.py is_err is_err -->

View file

@ -1,3 +1,3 @@
# is_none # is_none
<!-- cmdrun python3 ../extract_doc_comment.py is_none --> <!-- cmdrun python3 ../extract_doc_comment.py is_none is_none -->

View file

@ -1,3 +1,3 @@
# is_ok # is_ok
<!-- cmdrun python3 ../extract_doc_comment.py is_ok --> <!-- cmdrun python3 ../extract_doc_comment.py is_ok is_ok -->

View file

@ -1,3 +1,3 @@
# is_some # is_some
<!-- cmdrun python3 ../extract_doc_comment.py is_some --> <!-- cmdrun python3 ../extract_doc_comment.py is_some is_some -->

View file

@ -1,3 +1,3 @@
# use_cycle_list # use_cycle_list
<!-- cmdrun python3 ../extract_doc_comment.py use_cycle_list --> <!-- cmdrun python3 ../extract_doc_comment.py use_cycle_list use_cycle_list -->

View file

@ -1,3 +1,3 @@
# use_debounce_fn # use_debounce_fn
<!-- cmdrun python3 ../extract_doc_comment.py use_debounce_fn --> <!-- cmdrun python3 ../extract_doc_comment.py use_debounce_fn use_debounce_fn -->

View file

@ -1,3 +1,3 @@
# use_supported # use_supported
<!-- cmdrun python3 ../extract_doc_comment.py use_supported --> <!-- cmdrun python3 ../extract_doc_comment.py use_supported use_supported -->

View file

@ -1,3 +1,3 @@
# use_throttle_fn # use_throttle_fn
<!-- cmdrun python3 ../extract_doc_comment.py use_throttle_fn --> <!-- cmdrun python3 ../extract_doc_comment.py use_throttle_fn use_throttle_fn -->

View file

@ -1,3 +1,3 @@
# use_to_string # use_to_string
<!-- cmdrun python3 ../extract_doc_comment.py use_to_string --> <!-- cmdrun python3 ../extract_doc_comment.py use_to_string use_to_string -->

View file

@ -1,3 +1,3 @@
# watch_debounced # watch_debounced
<!-- cmdrun python3 ../extract_doc_comment.py watch_debounced --> <!-- cmdrun python3 ../extract_doc_comment.py watch_debounced watch_debounced -->

View file

@ -1,3 +1,3 @@
# watch_pausable # watch_pausable
<!-- cmdrun python3 ../extract_doc_comment.py watch_pausable --> <!-- cmdrun python3 ../extract_doc_comment.py watch_pausable watch_pausable -->

View file

@ -1,3 +1,3 @@
# watch_throttled # watch_throttled
<!-- cmdrun python3 ../extract_doc_comment.py watch_throttled --> <!-- cmdrun python3 ../extract_doc_comment.py watch_throttled watch_throttled -->

View file

@ -1,3 +1,3 @@
# watch_with_options # watch_with_options
<!-- cmdrun python3 ../extract_doc_comment.py watch --> <!-- cmdrun python3 ../extract_doc_comment.py watch watch -->

View file

@ -1,3 +1,3 @@
# whenever # whenever
<!-- cmdrun python3 ../extract_doc_comment.py whenever --> <!-- cmdrun python3 ../extract_doc_comment.py whenever whenever -->

View file

@ -11,12 +11,12 @@ variables:
default_value: "" default_value: ""
ask: Module [optional] ask: Module [optional]
- name: feature - name: feature
default_value: "" default_value: "{{ function_name }}"
ask: cfg feature [optional] ask: cfg feature
ignores: ignores:
- modify_files.py - modify_files.py
- createfn.sh - createfn.sh
scripts: scripts:
- cmd: python3 template/modify_files.py {{ function_name }} {{ category }}{{#if module}} --module {{ module }}{{/if}}{{#if feature}} --feature {{ feature }}{{/if}} - cmd: python3 template/modify_files.py {{ function_name }} {{ category }}{{#if module}} --module {{ module }}{{/if}} --feature {{ feature }}

View file

@ -8,7 +8,7 @@ leptos = { version = "0.6", features = ["nightly", "csr"] }
console_error_panic_hook = "0.1" console_error_panic_hook = "0.1"
console_log = "1" console_log = "1"
log = "0.4" log = "0.4"
leptos-use = { path = "../..", features = ["docs"{{#if feature}}, "{{ feature }}"{{/if}}] } leptos-use = { path = "../..", features = ["{{ feature }}", "docs"] }
web-sys = "0.3" web-sys = "0.3"
[dev-dependencies] [dev-dependencies]

View file

@ -25,8 +25,8 @@ use leptos::*;
/// ``` /// ```
/// ///
/// ## Server-Side Rendering /// ## Server-Side Rendering
/// {{#if feature}} ///
// #[doc(cfg(feature = "{{feature}}"))]{{/if}} // #[doc(cfg(feature = "{{feature}}"))]
pub fn {{ function_name }}() -> {{ to_pascal_case function_name }}Return { pub fn {{ function_name }}() -> {{ to_pascal_case function_name }}Return {
{{ function_name }}_with_options({{ to_pascal_case function_name }}Options::default()) {{ function_name }}_with_options({{ to_pascal_case function_name }}Options::default())