diff --git a/docs/css/style.css b/docs/css/style.css index 49b8c02..e77166b 100644 --- a/docs/css/style.css +++ b/docs/css/style.css @@ -167,4 +167,4 @@ code.doc-symbol-module { code.doc-symbol-module::after { content: "mod"; -} \ No newline at end of file +} diff --git a/docs/getting_started.md b/docs/getting_started.md index 3957b50..755f8bc 100644 --- a/docs/getting_started.md +++ b/docs/getting_started.md @@ -111,7 +111,7 @@ print(get_things_name()) # prints "Thing" @store.inject def get_things_name(thing: Thing) -> str: return thing.name - + print(get_things_name()) # prints "Thing" ``` @@ -195,7 +195,7 @@ get_things_name(Thing('Bob')) # prints "Hello, Bob!" (and still returns "Bob") ## Real world example -Let's look at a more realistic example. +Let's look at a more realistic example. Suppose we have an application like a text editor or IDE that allows plugins to provide functionality like syntax highlighting, code completion, etc. We might diff --git a/src/in_n_out/_global.py b/src/in_n_out/_global.py index 13c60e5..de5766d 100644 --- a/src/in_n_out/_global.py +++ b/src/in_n_out/_global.py @@ -54,7 +54,7 @@ def register( store: str | Store | None = None, ) -> InjectionContext: """Register multiple providers and/or processors in `store` or the global store. - + See [`Store.register`][in_n_out.Store.register] for details. """ return _store_or_global(store).register(providers=providers, processors=processors) @@ -68,7 +68,7 @@ def register_provider( store: str | Store | None = None, ) -> InjectionContext: """Register a provider in `store` or the global store. - + See [`Store.register_provider`][in_n_out.Store.register_provider] for details. """ return _store_or_global(store).register_provider( @@ -84,7 +84,7 @@ def register_processor( store: str | Store | None = None, ) -> InjectionContext: """Register a processor in `store` or the global store. - + See [`Store.register_processor`][in_n_out.Store.register_processor] for details. """ return _store_or_global(store).register_processor( @@ -123,8 +123,8 @@ def mark_provider( store: str | Store | None = None, ) -> Callable[[ProviderVar], ProviderVar] | ProviderVar: """Decorate `func` as a provider in `store` or the global store. - - See [`Store.mark_provider`][in_n_out.Store.mark_provider] for details. + + See [`Store.mark_provider`][in_n_out.Store.mark_provider] for details. """ return _store_or_global(store).mark_provider( func, weight=weight, type_hint=type_hint @@ -162,7 +162,7 @@ def mark_processor( store: str | Store | None = None, ) -> Callable[[ProcessorVar], ProcessorVar] | ProcessorVar: """Decorate `func` as a processor in `store` or the global store. - + See [`Store.mark_processor`][in_n_out.Store.mark_processor] for details. """ return _store_or_global(store).mark_processor( @@ -175,7 +175,7 @@ def iter_providers( type_hint: object | type[T], store: str | Store | None = None ) -> Iterable[Callable[[], T | None]]: """Iterate over all providers of `type_hint` in `store` or the global store. - + See [`Store.iter_providers`][in_n_out.Store.iter_providers] for details. """ return _store_or_global(store).iter_providers(type_hint) @@ -186,7 +186,7 @@ def iter_processors( type_hint: object | type[T], store: str | Store | None = None ) -> Iterable[Callable[[T], Any]]: """Iterate over all processors of `type_hint` in `store` or the global store. - + See [`Store.iter_processors`][in_n_out.Store.iter_processors] for details. """ return _store_or_global(store).iter_processors(type_hint) @@ -198,7 +198,7 @@ def provide( store: str | Store | None = None, ) -> T | None: """Provide an instance of `type_hint` with providers from `store` or the global store. - + See [`Store.provide`][in_n_out.Store.provide] for details. """ # noqa: E501 return _store_or_global(store).provide(type_hint=type_hint) @@ -214,7 +214,7 @@ def process( store: str | Store | None = None, ) -> None: """Process an instance of `type_` with processors from `store` or the global store. - + See [`Store.process`][in_n_out.Store.process] for details. """ return _store_or_global(store).process( @@ -271,7 +271,7 @@ def inject( store: str | Store | None = None, ) -> Callable[..., R] | Callable[[Callable[P, R]], Callable[..., R]]: """Decorate `func` to inject dependencies at calltime from `store` or the global store. - + See [`Store.inject`][in_n_out.Store.inject] for details. """ # noqa: E501 return _store_or_global(store).inject( @@ -319,7 +319,7 @@ def inject_processors( store: str | Store | None = None, ) -> Callable[[Callable[P, R]], Callable[P, R]] | Callable[P, R]: """Decorate a function to process its output from `store` or the global store. - + See [`Store.inject_processors`][in_n_out.Store.inject_processors] for details. """ return _store_or_global(store).inject_processors(