Skip to content

Sphinx documentation#125

Merged
python273 merged 10 commits intopython273:docsfrom
hdk5:docs
Apr 14, 2018
Merged

Sphinx documentation#125
python273 merged 10 commits intopython273:docsfrom
hdk5:docs

Conversation

@hdk5
Copy link
Copy Markdown
Contributor

@hdk5 hdk5 commented Apr 1, 2018

Здесь буду докладывать о работе над документацией

Comment thread jconfig/base.py
:license: Apache License, Version 2.0, see LICENSE file

Copyright (C) 2018
:copyright: (c) 2018 python273
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Хмм, кажется это какой-то дефолтный формат был, не уверен стоит ли менять

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Хотя думаю ок. Думаю еще можно добавлять краткое описание как в requests: https://github.com/requests/requests/blob/master/requests/api.py

Comment thread jconfig/base.py Outdated
def save(self):
"""
Абстрактный метод, должен сохранять конфиг
"""
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Лучше в одну строку такое
""" Something """
/

""" Something

:param ...
""""

Comment thread docs/conf.py
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = 'en'
language = 'ru'
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Не уверен стоит ли ставить ru, там вроде как не все переведено, так что может оставить en 🤔

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

имхо, лучше полторы непереведённые фразы от генератора доков, чем вообще весь интерфейс на одном языке, а сами доки - на другом

Comment thread vk_api/vk_api.py Outdated
api_version='5.73', app_id=6222115, scope=DEFAULT_USER_SCOPE,
client_secret=None):
# TODO: убрать config_filename, в качестве config брать объект, а не класс
# TODO: убрать auth_handler и captcha_handler - это должно происходить через наследование
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Думаю их стоит оставить, они часто нужны

Comment thread vk_api/vk_api.py
config=jconfig.Config, config_filename='vk_config.v2.json',
api_version='5.73', app_id=6222115, scope=DEFAULT_USER_SCOPE,
client_secret=None):
# TODO: убрать config_filename, в качестве config брать объект, а не класс
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Не уверен, что получится. Сейчас там передается секция: config(self.login, filename=config_filename). Хотя можно попробовать добавить смену секции в jconfig, но нужно ли 🤔

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

В таком случае у тебя вроде бы и предполагается, что можно наследоваться от BaseConfig, и в то же время VkApi умеет создавать объект такого класса только когда у него в инициализаторе имя секции и имя файла.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Да, но в .load могут любые kwargs прилететь, и BaseConfig принимает kwargs

@python273
Copy link
Copy Markdown
Owner

В целом выглядит хорошо, может стоит в разные файлы вынести подмодули типа аудио, тулзы, лонгпул, етц

@hdk5
Copy link
Copy Markdown
Contributor Author

hdk5 commented Apr 5, 2018

Билд форка на RTFD http://vk-api-fork-hdk5.readthedocs.io/ru/docs/

@hdk5
Copy link
Copy Markdown
Contributor Author

hdk5 commented Apr 6, 2018

И кстати, в основном классе обычно используются методы auth, get_api и, может быть, поле http. Нужна ли вообще документация по всему остальному?

@python273
Copy link
Copy Markdown
Owner

python273 commented Apr 7, 2018

Раньше было лучше и думаю лучше оставить "Star" вместо "Watch" 😃
screen shot 2018-04-07 at 3 05 30 pm

И кстати, в основном классе обычно используются методы auth, get_api и, может быть, поле http. Нужна ли вообще документация по всему остальному?

Я вот думаю стоит скрыть vk_login, twofactor, security_check, check_sid, api_login через def _. Можно добавить в auth only_cookies, хотя можно и не добавлять

@python273
Copy link
Copy Markdown
Owner

Поменял названия с "Модуль X" на названия классов, где предполагается использование только одного класса из файла

@python273
Copy link
Copy Markdown
Owner

Вроде все ок. Получается остается:

  • Скрыть методы VkApi
  • Добавить ссылки на примеры (можно либо в index, либо для каждого модуля отдельно)
  • Думаю не стоит менять config, config_filename. Хотя выглядит немного костыльно, конечно

@hdk5
Copy link
Copy Markdown
Contributor Author

hdk5 commented Apr 7, 2018

Раньше было лучше и думаю лучше оставить "Star" вместо "Watch"

И орки зеленее. html_sidebars скопировал из документации к alabaster. Без навигации очень неудобно. Насчёт кнопки согласен, но нет нужды пихать свой html, это меняется прямо в настройках темы.

Я вот думаю стоит скрыть ...

Сделаешь сам?

Добавить ссылки на примеры

В индексе достаточно, думаю.

@python273 python273 merged commit c2dbd4e into python273:docs Apr 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants