diff --git a/.requirements/requirements.txt b/.requirements/requirements.txt index d6f0ab3..e00f80c 100644 --- a/.requirements/requirements.txt +++ b/.requirements/requirements.txt @@ -2,5 +2,5 @@ colorama==0.4.6 ; python_version >= "3.10" and python_version < "4.0" and sys_pl dynaconf==3.2.0 ; python_version >= "3.10" and python_version < "4.0" emoji==2.7.0 ; python_version >= "3.10" and python_version < "4.0" loguru==0.7.0 ; python_version >= "3.10" and python_version < "4.0" -pyparsing==3.1.0 ; python_version >= "3.10" and python_version < "4.0" +pyparsing==3.1.1 ; python_version >= "3.10" and python_version < "4.0" win32-setctime==1.1.0 ; python_version >= "3.10" and python_version < "4.0" and sys_platform == "win32" diff --git a/docs/01_start.rst b/docs/01_start.rst new file mode 100644 index 0000000..8a26f0e --- /dev/null +++ b/docs/01_start.rst @@ -0,0 +1,23 @@ +=============== +Getting Started +=============== + + +Installation +============ + +:: + + pip install findmyorder + + +Example +======= + +The following example illustrate how to use the module + + +.. rli:: https://raw.githubusercontent.com/mraniki/dxsp/main/dxsp/example.py + :language: python + + \ No newline at end of file diff --git a/docs/02_config.rst b/docs/02_config.rst new file mode 100644 index 0000000..97be75e --- /dev/null +++ b/docs/02_config.rst @@ -0,0 +1,13 @@ + +====== +Config +====== + + +Setting available via settings.toml or .env + + +.. rli:: https://raw.githubusercontent.com/mraniki/findmyorder/main/findmyorder/default_settings.toml + :language: toml + + diff --git a/docs/03_module.rst b/docs/03_module.rst new file mode 100644 index 0000000..1ec9142 --- /dev/null +++ b/docs/03_module.rst @@ -0,0 +1,11 @@ + +====== +Module +====== + +.. autosummary:: + :toctree: _autosummary + :template: custom-module-template.rst + :recursive: + + findmyorder \ No newline at end of file diff --git a/docs/_static/custom.css b/docs/_static/custom.css new file mode 100644 index 0000000..bbb919f --- /dev/null +++ b/docs/_static/custom.css @@ -0,0 +1,27 @@ +/* +#073BD9 +#05C7F2 +#05F2F2 +#F2DA63 +#F2E6A7 +*/ + + +:root { + --body-bg: #292929; + --body-color: #E2E8E4; + } + + .navbar-inverse, .navbar-collapse, .navbar-brand:hover, .navbar-default, .navbar-inverse .navbar-brand:focus, .navbar-inverse .navbar-nav > li > a:hover, .navbar-inverse .navbar-nav > li > a:focus { + background-color: #222222; + } + + a { + color: #ffcc00; + } + a:hover { + color: #ffcc00; ; + } + + + \ No newline at end of file diff --git a/docs/_static/favicon.ico b/docs/_static/favicon.ico new file mode 100644 index 0000000..ba4a984 Binary files /dev/null and b/docs/_static/favicon.ico differ diff --git a/docs/_static/favicon.png b/docs/_static/favicon.png new file mode 100644 index 0000000..597bfdf Binary files /dev/null and b/docs/_static/favicon.png differ diff --git a/docs/_static/logo-full.png b/docs/_static/logo-full.png new file mode 100644 index 0000000..ee787a8 Binary files /dev/null and b/docs/_static/logo-full.png differ diff --git a/docs/_templates/custom-class-template.rst b/docs/_templates/custom-class-template.rst new file mode 100644 index 0000000..d5fd0a5 --- /dev/null +++ b/docs/_templates/custom-class-template.rst @@ -0,0 +1,34 @@ +{{ fullname | escape | underline}} + +.. currentmodule:: {{ module }} + +.. autoclass:: {{ objname }} + :members: + :undoc-members: + :show-inheritance: + :inherited-members: + + {% block methods %} + {% if methods %} + .. rubric:: {{ _('Methods') }} + + .. autosummary:: + {% for item in methods %} + {%- if not item.startswith('_') %} + ~{{ name }}.{{ item }} + {%- endif -%} + {%- endfor %} + {% endif %} + {% endblock %} + + {% block attributes %} + {% if attributes %} + .. rubric:: {{ _('Attributes') }} + + .. autosummary:: + {% for item in attributes %} + ~{{ name }}.{{ item }} + {%- endfor %} + {% endif %} + {% endblock %} + diff --git a/docs/_templates/custom-module-template.rst b/docs/_templates/custom-module-template.rst new file mode 100644 index 0000000..dd90e32 --- /dev/null +++ b/docs/_templates/custom-module-template.rst @@ -0,0 +1,66 @@ +{{ fullname | escape | underline}} + +.. automodule:: {{ fullname }} + + {% block attributes %} + {% if attributes %} + .. rubric:: Module attributes + + .. autosummary:: + :toctree: + {% for item in attributes %} + {{ item }} + {%- endfor %} + {% endif %} + {% endblock %} + + {% block functions %} + {% if functions %} + .. rubric:: {{ _('Functions') }} + + .. autosummary:: + :toctree: + :nosignatures: + {% for item in functions %} + {{ item }} + {%- endfor %} + {% endif %} + {% endblock %} + + {% block classes %} + {% if classes %} + .. rubric:: {{ _('Classes') }} + + .. autosummary:: + :toctree: + :template: custom-class-template.rst + :nosignatures: + {% for item in classes %} + {{ item }} + {%- endfor %} + {% endif %} + {% endblock %} + + {% block exceptions %} + {% if exceptions %} + .. rubric:: {{ _('Exceptions') }} + + .. autosummary:: + :toctree: + {% for item in exceptions %} + {{ item }} + {%- endfor %} + {% endif %} + {% endblock %} + +{% block modules %} +{% if modules %} +.. autosummary:: + :toctree: + :template: custom-module-template.rst + :recursive: +{% for item in modules %} + {{ item }} +{%- endfor %} +{% endif %} +{% endblock %} \ No newline at end of file diff --git a/docs/_templates/navbar.html b/docs/_templates/navbar.html new file mode 100644 index 0000000..cd9fd60 --- /dev/null +++ b/docs/_templates/navbar.html @@ -0,0 +1,105 @@ + \ No newline at end of file diff --git a/docs/conf.py b/docs/conf.py index 5f7e8f0..202cf7c 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,216 +1,99 @@ # Configuration file for the Sphinx documentation builder. + +import os import sys -from os.path import abspath, dirname -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -# -# import os import sphinx_bootstrap_theme -path = dirname(abspath(__file__)) -sys.path.append(path) -# For the full list of built-in configuration values, see the documentation: -# https://www.sphinx-doc.org/en/master/usage/configuration.html +sys.path.insert(0, os.path.abspath('../')) + # -- Project information ----------------------------------------------------- -# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information -project = 'findmyorder' +project = 'dxsp' copyright = '2023, mraniki' author = 'mraniki' # -- General configuration --------------------------------------------------- -# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration extensions = [ 'sphinx.ext.autodoc', - 'sphinx.ext.coverage', - 'sphinx.ext.viewcode', + 'sphinx.ext.autosummary', 'sphinx.ext.napoleon', - 'sphinx.ext.intersphinx', - 'sphinx.ext.todo', - 'sphinx_copybutton', - 'myst_parser', + 'sphinx.ext.viewcode', 'sphinxext.remoteliteralinclude', - 'sphinx_togglebutton', - # 'sphinx_inline_tabs', - # 'sphinx_reredirects', - # 'sphinx_design', - 'notfound.extension' - ] -source_suffix = ['.rst', '.md'] -# -- Napoleon Settings ----------------------------------------------------- +# -- Extension configuration --------------------------------------------------- + napoleon_google_docstring = True -napoleon_numpy_docstring = False -napoleon_include_init_with_doc = False -napoleon_include_private_with_doc = False -napoleon_include_special_with_doc = False -napoleon_use_admonition_for_examples = False -napoleon_use_admonition_for_notes = False -napoleon_use_admonition_for_references = False -napoleon_use_ivar = True -napoleon_use_param = True -napoleon_use_rtype = True -napoleon_use_keyword = True +autosummary_generate = True +autoclass_content = 'both' +autodoc_inherit_docstrings = True +set_type_checking_flag = True autodoc_member_order = 'bysource' -add_module_names = False +add_module_names = True master_doc = 'index' - -# Add any paths that contain templates here, relative to this directory. +source_suffix = ['.rst', '.md'] templates_path = ["_templates"] - -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -# This pattern also affects html_static_path and html_extra_path. exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] -# -- Options for HTML output ------------------------------------------------- -# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output - # -- Options for HTML output ------------------------------------------------- -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -# -# html_theme = "nature" html_theme = "bootstrap" -html_theme_path = sphinx_bootstrap_theme.get_html_theme_path() -# (Optional) Logo. Should be small enough to fit the navbar (ideally 24x24). -# Path should be relative to the ``_static`` files directory. -# html_logo = "_static/logo-white.png" -# html_favicon = "_static/favicon.png" - -html_copy_source = False -html_show_sourcelink = False - - -# Redirect URLs -# "": "" -#redirects = {} - - -# Theme options are theme-specific and customize the look and feel of a -# theme further. +html_theme_path = sphinx_bootstrap_theme.get_html_theme_path() +html_static_path = ["_static"] +html_logo = '_static/favicon.png' +html_favicon = '_static/favicon.ico' +html_css_files = [ + "custom.css", +] +html_show_sphinx = False html_theme_options = { - # Tab name for entire site. (Default: "Site") - #'navbar_site_name': "Table of Contents", - - # A list of tuples containing pages or urls to link to. - # Valid tuples should be in the following forms: - # (name, page) # a link to a page - # (name, "/aa/bb", 1) # a link to an arbitrary relative url - # (name, "http://example.com", True) # arbitrary absolute url - # Note the "1" or "True" value above as the third argument to indicate - # an arbitrary url. - # 'navbar_links': [ - # ("_menu", "Essentials", [ - # ("TalkyTrader", "index"), - # ("_divider", ), - # ("_menu", "Installation", "home/installation", [ - # ("Local Walkthrough", "home/guides/local"), - # ("Docker Walkthrough", "home/guides/docker"), - # ]), - # ("Environment Variables", "home/environmental"), - # ("Knowledgebase/FAQ", "home/kb"), - # ]), - # ("_divider", ), - # ("Bugs/Issues", "https://github.com/mraniki/tt/issues"), - # ], - - # Render the next and previous page links in navbar. (Default: true) + 'navbar_title': " ", + 'navbar_site_name': "Talky", 'navbar_sidebarrel': False, - - # Render the current pages TOC in the navbar. (Default: true) 'navbar_pagenav': False, - - # Tab name for the current pages TOC. (Default: "Page") - 'navbar_pagenav_name': "Sections", - - # Global TOC depth for "site" navbar tab. (Default: 1) - # Switching to -1 shows all levels. - 'globaltoc_depth': 2, - - # Include hidden TOCs in Site navbar? - # - # Note: If this is "false", you cannot have mixed ``:hidden:`` and - # non-hidden ``toctree`` directives in the same page, or else the build - # will break. - # - # Values: "true" (default) or "false" + 'globaltoc_depth': 4, 'globaltoc_includehidden': "true", - - # HTML navbar class (Default: "navbar") to attach to
element. - # For black navbar, do "navbar navbar-inverse" - 'navbar_class': "navbar navbar-inverse", - - # Fix navigation bar to top of page? - # Values: "true" (default) or "false" + 'navbar_class': "navbar", 'navbar_fixed_top': "true", + 'source_link_position': "none", - # Location of link to source. - # Options are "nav" (default), "footer" or anything else to exclude. - 'source_link_position': "nav", - - # Bootswatch (http://bootswatch.com/) theme. - # - # Options are nothing (default) or the name of a valid theme - # such as "cosmo" or "sandstone". - # - # The set of valid themes depend on the version of Bootstrap - # that's used (the next config option). - # - # Currently, the supported themes are: - # - Bootstrap 2: https://bootswatch.com/2 - # - Bootstrap 3: https://bootswatch.com/3 'bootswatch_theme': "darkly", - - # Choose Bootstrap version. - # Values: "3" (default) or "2" (in quotes) 'bootstrap_version': "3", - } + 'navbar_links': [ + ("TalkyTrader", "https://talkytrader.github.io/wiki/",True), + ("_menu", "🗿 Talky",[ + ("🪙 Get started", "https://talky.rtfd.io/01_start",True), + ("⚙️ Config", "https://talky.rtfd.io/02_config",True), + ]), + ("_menu", "🔌 Plugins",[ + ("👂 IamListening", "https://iamlistening.rtfd.io/", True), + ("🔎 FindMyOrder", "https://findmyorder.rtfd.io/", True), + ("⛓️ DXSP", "https://dxsp.rtfd.io/", True), + ("💱 CEX", "index",True), + ("💁 Helper", "index",True), + ("📰 Talkytrend", "https://talkytrend.rtfd.io/", True), + ]), + ("_menu", "➕ More",[ + ("🆕 What's new?", "https://github.com/mraniki/tt",True), + ("💬 Connect", "https://talky.rtfd.io",True), + ]), + ] -# -- Options for HTML output ------------------------------------------------- -# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ["_static"] - -html_css_files = [ - "custom.css", - "https://cdn.jsdelivr.net/npm/bootswatch@5.3.0/dist/darkly/bootstrap.min.css" - #"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.1/css/all.min.css" -] - - -intersphinx_mapping = { - "talkytrader": ("https://talky.readthedocs.io", None), - "findmyorder": ("https://findmyorder.readthedocs.io", None), - "dxsp": ("https://dxsp.readthedocs.io", None), - "iamlistening": ("https://iamlistening.readthedocs.io", None), - "talkytrend": ("https://talkytrend.readthedocs.io", None), } -# We recommend adding the following config value. -# Sphinx defaults to automatically resolve *unresolved* labels using all your Intersphinx mappings. -# This behavior has unintended side-effects, namely that documentations local references can -# suddenly resolve to an external location. -# See also: -# https://www.sphinx-doc.org/en/master/usage/extensions/intersphinx.html#confval-intersphinx_disabled_reftypes -intersphinx_disabled_reftypes = ["*"] + def setup(app): app.add_css_file("custom.css") + diff --git a/docs/findmyorder.rst b/docs/findmyorder.rst deleted file mode 100644 index 41e3768..0000000 --- a/docs/findmyorder.rst +++ /dev/null @@ -1,29 +0,0 @@ -findmyorder package -=================== - -Submodules ----------- - -findmyorder.config module -------------------------- - -.. automodule:: findmyorder.config - :members: - :undoc-members: - :show-inheritance: - -findmyorder.main module ------------------------ - -.. automodule:: findmyorder.main - :members: - :undoc-members: - :show-inheritance: - -Module contents ---------------- - -.. automodule:: findmyorder - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/index.rst b/docs/index.rst index 0cd7f27..1a0339f 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1,68 +1,21 @@ -.. findmyorder documentation, Mon Jun 5 19:56:53 2023. - +.. _findmyorder_index: +=========== FindMyOrder =========== -.. image:: https://user-images.githubusercontent.com/8766259/233823991-cceaa05a-ff15-4796-a6bb-bcb3ee0d8859.jpg - :align: right - :width: 50 +| Find My order, +| a parsing package to find trading order .. toctree:: - :maxdepth: 3 - :caption: Contents: - - - -How To Use it -================== -the following example illustrate how to use the module - -.. note:: - :class: dropdown - - .. rli:: https://raw.githubusercontent.com/mraniki/findmyorder/main/examples/example.py - :language: python - - - - - - -Settings -================== -Setting available via settings.toml - -.. note:: - :class: dropdown - - .. rli:: https://raw.githubusercontent.com/mraniki/findmyorder/main/findmyorder/default_settings.toml - :language: toml - - - - - - -FMO class -================== -* :doc:`findmyorder ` - - -.. Indices and tables -.. ================== + :maxdepth: 4 + + 01_start + 02_config + 03_module -.. * :ref:`genindex` -.. * :ref:`modindex` -.. * :ref:`search` +.. raw:: html -Talky -================== -* :doc:`Talkytrader ` -.. * :doc:`findmyorder ` -.. * :doc:`DXSP ` -.. * :doc:`IamListening ` -.. * :doc:`TalkyTrend ` -.. * `Talkytrader ` +
diff --git a/docs/modules.rst b/docs/modules.rst deleted file mode 100644 index 18c7c31..0000000 --- a/docs/modules.rst +++ /dev/null @@ -1,7 +0,0 @@ -findmyorder -=========== - -.. toctree:: - :maxdepth: 4 - - findmyorder diff --git a/pyproject.toml b/pyproject.toml index 14e97d7..1465226 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -67,14 +67,10 @@ pytest-loguru = "^0.2.0" optional = true [tool.poetry.group.docs.dependencies] -sphinx = "^7.0.0" +sphinx = ">=5,<6" sphinx_bootstrap_theme = "^0.8.1" -sphinx-autoapi = "^2.1.1" -sphinx-copybutton= "^0.5.2" -myst-parser = "^2.0.0" -sphinx-notfound-page = "^0.8.3" sphinxext-remoteliteralinclude = "^0.4.0" -sphinx-togglebutton = "*" + [tool.pytest.ini_options] pythonpath = "."