Merge lp:~mhall119/developer-ubuntu-com/apidoc-frameworks-creation into lp:developer-ubuntu-com
- apidoc-frameworks-creation
- Merge into stable
Proposed by
Michael Hall
on 2016-02-24
| Status: | Merged |
|---|---|
| Approved by: | Daniel Holbach on 2016-03-21 |
| Approved revision: | 192 |
| Merged at revision: | 196 |
| Proposed branch: | lp:~mhall119/developer-ubuntu-com/apidoc-frameworks-creation |
| Merge into: | lp:developer-ubuntu-com |
| Diff against target: |
444 lines (+157/-57) 12 files modified
api_docs/admin.py (+1/-1) api_docs/management/commands/import_cordova.py (+6/-1) api_docs/management/commands/import_doxygen.py (+6/-1) api_docs/management/commands/import_qdoc.py (+6/-1) api_docs/management/commands/import_sphinx.py (+6/-1) api_docs/management/commands/import_yuidoc.py (+6/-1) api_docs/models.py (+46/-8) api_docs/templates/api_docs/version.html (+8/-0) api_docs/templates/api_docs/version_edit.html (+12/-15) api_docs/urls.py (+1/-0) api_docs/views.py (+32/-0) update_apidocs.sh (+27/-28) |
| To merge this branch: | bzr merge lp:~mhall119/developer-ubuntu-com/apidoc-frameworks-creation |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Daniel Holbach (community) | 2016-02-24 | Approve on 2016-03-21 | |
|
Review via email:
|
|||
Commit Message
Updates to make it easier to manage new framework releases
Description of the Change
Updates to make it easier to manage new framework releases
* Change importers to allow targeting version aliases (development & current)
* Add clone methods to API docs models
* Add "New Release" link to development version page (only for admins)
* Add page for defining the new development version name
To post a comment you must log in.
| Michael Hall (mhall119) wrote : | # |
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
| 1 | === modified file 'api_docs/admin.py' |
| 2 | --- api_docs/admin.py 2015-02-05 14:24:04 +0000 |
| 3 | +++ api_docs/admin.py 2016-02-24 17:45:37 +0000 |
| 4 | @@ -7,7 +7,7 @@ |
| 5 | admin.site.register(Topic, TopicAdmin) |
| 6 | |
| 7 | class LanguageAdmin(admin.ModelAdmin): |
| 8 | - list_display = ('name', 'slug', 'topic') |
| 9 | + list_display = ('name', 'slug', 'topic', 'current_version', 'development_version') |
| 10 | list_filter = ('topic',) |
| 11 | search_fields = ('name', 'slug') |
| 12 | admin.site.register(Language, LanguageAdmin) |
| 13 | |
| 14 | === modified file 'api_docs/management/commands/import_cordova.py' |
| 15 | --- api_docs/management/commands/import_cordova.py 2015-02-17 20:14:09 +0000 |
| 16 | +++ api_docs/management/commands/import_cordova.py 2016-02-24 17:45:37 +0000 |
| 17 | @@ -51,7 +51,12 @@ |
| 18 | verbosity = int(options.get('verbosity', 0)) |
| 19 | topic = Topic.objects.get(slug=options.get('topic')) |
| 20 | language = Language.objects.get(slug=options.get('lang'), topic=topic) |
| 21 | - version = Version.objects.get(slug=options.get('version'), language=language) |
| 22 | + if options.get('version') == 'development': |
| 23 | + version = language.development_version |
| 24 | + elif options.get('version') == 'current': |
| 25 | + version = language.current_version |
| 26 | + else: |
| 27 | + version = Version.objects.get(slug=options.get('version'), language=language) |
| 28 | section = None # Determined at runtime |
| 29 | |
| 30 | importer = CordovaImporter(topic, language, version, section, options) |
| 31 | |
| 32 | === modified file 'api_docs/management/commands/import_doxygen.py' |
| 33 | --- api_docs/management/commands/import_doxygen.py 2015-02-17 20:14:09 +0000 |
| 34 | +++ api_docs/management/commands/import_doxygen.py 2016-02-24 17:45:37 +0000 |
| 35 | @@ -90,7 +90,12 @@ |
| 36 | verbosity = int(options.get('verbosity', 0)) |
| 37 | topic = Topic.objects.get(slug=options.get('topic')) |
| 38 | language = Language.objects.get(slug=options.get('lang'), topic=topic) |
| 39 | - version = Version.objects.get(slug=options.get('version'), language=language) |
| 40 | + if options.get('version') == 'development': |
| 41 | + version = language.development_version |
| 42 | + elif options.get('version') == 'current': |
| 43 | + version = language.current_version |
| 44 | + else: |
| 45 | + version = Version.objects.get(slug=options.get('version'), language=language) |
| 46 | section = None # Will be determined during import |
| 47 | |
| 48 | importer = DoxygenImporter(topic, language, version, section, options) |
| 49 | |
| 50 | === modified file 'api_docs/management/commands/import_qdoc.py' |
| 51 | --- api_docs/management/commands/import_qdoc.py 2015-02-17 20:14:09 +0000 |
| 52 | +++ api_docs/management/commands/import_qdoc.py 2016-02-24 17:45:37 +0000 |
| 53 | @@ -83,7 +83,12 @@ |
| 54 | verbosity = int(options.get('verbosity', 0)) |
| 55 | topic = Topic.objects.get(slug=options.get('topic')) |
| 56 | language = Language.objects.get(slug=options.get('lang'), topic=topic) |
| 57 | - version = Version.objects.get(slug=options.get('version'), language=language) |
| 58 | + if options.get('version') == 'development': |
| 59 | + version = language.development_version |
| 60 | + elif options.get('version') == 'current': |
| 61 | + version = language.current_version |
| 62 | + else: |
| 63 | + version = Version.objects.get(slug=options.get('version'), language=language) |
| 64 | section, created = Section.objects.get_or_create(name=options.get('section'), topic_version=version) |
| 65 | |
| 66 | importer = QDocImporter(topic, language, version, section, options) |
| 67 | |
| 68 | === modified file 'api_docs/management/commands/import_sphinx.py' |
| 69 | --- api_docs/management/commands/import_sphinx.py 2015-02-05 14:24:04 +0000 |
| 70 | +++ api_docs/management/commands/import_sphinx.py 2016-02-24 17:45:37 +0000 |
| 71 | @@ -90,7 +90,12 @@ |
| 72 | verbosity = int(options.get('verbosity', 0)) |
| 73 | topic = Topic.objects.get(slug=options.get('topic')) |
| 74 | language = Language.objects.get(slug=options.get('lang'), topic=topic) |
| 75 | - version = Version.objects.get(slug=options.get('version'), language=language) |
| 76 | + if options.get('version') == 'development': |
| 77 | + version = language.development_version |
| 78 | + elif options.get('version') == 'current': |
| 79 | + version = language.current_version |
| 80 | + else: |
| 81 | + version = Version.objects.get(slug=options.get('version'), language=language) |
| 82 | section = None # Will be determined during import |
| 83 | |
| 84 | importer = SphinxImporter(topic, language, version, section, options) |
| 85 | |
| 86 | === modified file 'api_docs/management/commands/import_yuidoc.py' |
| 87 | --- api_docs/management/commands/import_yuidoc.py 2015-02-17 20:14:09 +0000 |
| 88 | +++ api_docs/management/commands/import_yuidoc.py 2016-02-24 17:45:37 +0000 |
| 89 | @@ -76,7 +76,12 @@ |
| 90 | verbosity = int(options.get('verbosity', 0)) |
| 91 | topic = Topic.objects.get(slug=options.get('topic')) |
| 92 | language = Language.objects.get(slug=options.get('lang'), topic=topic) |
| 93 | - version = Version.objects.get(slug=options.get('version'), language=language) |
| 94 | + if options.get('version') == 'development': |
| 95 | + version = language.development_version |
| 96 | + elif options.get('version') == 'current': |
| 97 | + version = language.current_version |
| 98 | + else: |
| 99 | + version = Version.objects.get(slug=options.get('version'), language=language) |
| 100 | section, created = Section.objects.get_or_create(name=options.get('section'), topic_version=version) |
| 101 | |
| 102 | importer = YUIDocImporter(topic, language, version, section, options) |
| 103 | |
| 104 | === modified file 'api_docs/models.py' |
| 105 | --- api_docs/models.py 2015-02-26 15:26:20 +0000 |
| 106 | +++ api_docs/models.py 2016-02-24 17:45:37 +0000 |
| 107 | @@ -28,6 +28,10 @@ |
| 108 | name = models.CharField(max_length=64) |
| 109 | slug = models.CharField(max_length=64) |
| 110 | |
| 111 | + def import_from(self, target_version): |
| 112 | + for section in target_version.section_set.all(): |
| 113 | + self.section_set.add(section.clone()) |
| 114 | + |
| 115 | def __unicode__(self): |
| 116 | return self.language.topic.name +' '+self.language.name +' '+self.name |
| 117 | |
| 118 | @@ -41,6 +45,28 @@ |
| 119 | def __unicode__(self): |
| 120 | return self.topic_version.language.topic.name +' '+ self.topic_version.language.name +' '+self.topic_version.name+', '+self.name |
| 121 | |
| 122 | + def clone(self): |
| 123 | + new = Section(name=self.name, description=self.description, topic_version=self.topic_version) |
| 124 | + new.save() |
| 125 | + for namespace in self.namespace_set.all(): |
| 126 | + new.namespace_set.add(namespace.clone(new)) |
| 127 | + |
| 128 | + for element in self.element_set.all(): |
| 129 | + if not element.namespace: |
| 130 | + element.section = new |
| 131 | + element.id = None |
| 132 | + element.save() |
| 133 | + new.element_set.add(element) |
| 134 | + |
| 135 | + for page in self.page_set.all(): |
| 136 | + if not page.namespace: |
| 137 | + page.section = new |
| 138 | + page.id = None |
| 139 | + page.save() |
| 140 | + new.page_set.add(page) |
| 141 | + |
| 142 | + return new |
| 143 | + |
| 144 | @property |
| 145 | def topic(self): |
| 146 | return self.topic_version.topic |
| 147 | @@ -76,6 +102,26 @@ |
| 148 | def __unicode__(self): |
| 149 | return u'%s' % self.name |
| 150 | |
| 151 | + def clone(self, new_section): |
| 152 | + new = Namespace(name=self.name, display_name=self.display_name, data=self.data, source_file=self.source_file, source_format=self.source_format, platform_section=new_section) |
| 153 | + new.save() |
| 154 | + |
| 155 | + for element in self.element_set.all(): |
| 156 | + element.section = new_section |
| 157 | + element.namespace = new |
| 158 | + element.id = None |
| 159 | + element.save() |
| 160 | + new.element_set.add(element) |
| 161 | + |
| 162 | + for page in self.page_set.all(): |
| 163 | + page.section = new_section |
| 164 | + page.namespace = new |
| 165 | + page.id = None |
| 166 | + page.save() |
| 167 | + new.page_set.add(page) |
| 168 | + |
| 169 | + return new |
| 170 | + |
| 171 | @property |
| 172 | def display(self): |
| 173 | if self.display_name: |
| 174 | @@ -137,11 +183,3 @@ |
| 175 | def __unicode__(self): |
| 176 | return u'%s' % self.fullname |
| 177 | |
| 178 | -#class DocSource(models.Model): |
| 179 | - #'Source of API documentation' |
| 180 | - #source_name = models.CharField(max_length=64, help_text='Unique name, processed in alphabetical order') |
| 181 | - #source_url = models.UrlField(max_length=256, help_text='Publicly accessible download location') |
| 182 | - #last_run = models.DateTime(auto_now=True) |
| 183 | - #run_script = models.TextField(help_text='Script to run on package contents to import their docs') |
| 184 | - #last_stdout = models.TextField(help_text='Output from the last run') |
| 185 | - #last_stdeff = models.TextField(help_text='Errors from the last run') |
| 186 | |
| 187 | === modified file 'api_docs/templates/api_docs/version.html' |
| 188 | --- api_docs/templates/api_docs/version.html 2015-02-05 14:24:04 +0000 |
| 189 | +++ api_docs/templates/api_docs/version.html 2016-02-24 17:45:37 +0000 |
| 190 | @@ -9,6 +9,14 @@ |
| 191 | <li class="">{{version.name}}</li> |
| 192 | {% endblock %} |
| 193 | |
| 194 | +{% block nav_secondary %} |
| 195 | + {% if perms.api_docs.add_version and version.language.development_version == version %} |
| 196 | + <span style="float: right; vertical-align: middle;"><nav class="nav-secondary" style="border-bottom: 0px;"><ul><li><a href="{% url 'api_docs:release_version' language.topic.slug language.slug %}">New Release</a></li></ul></nav></span> |
| 197 | + {% endif %} |
| 198 | + {{block.super}} |
| 199 | +{% endblock nav_secondary%} |
| 200 | + |
| 201 | + |
| 202 | {% block content %} |
| 203 | <div class="row"> |
| 204 | <h2>{{version.language.name}} {{version.language.topic.name}} for {{version.name}}</h2> |
| 205 | |
| 206 | === modified file 'api_docs/templates/api_docs/version_edit.html' |
| 207 | --- api_docs/templates/api_docs/version_edit.html 2015-02-05 14:24:04 +0000 |
| 208 | +++ api_docs/templates/api_docs/version_edit.html 2016-02-24 17:45:37 +0000 |
| 209 | @@ -1,23 +1,20 @@ |
| 210 | -{% extends "api_docs/base.html" %} |
| 211 | +{% extends "base.html" %} |
| 212 | |
| 213 | -{% block editor_links %} |
| 214 | - <li><a href="{% url version_edit version.id %}?action=delete">Delete</a></li> |
| 215 | -{% endblock %} |
| 216 | +{% block title %}New Release - Ubuntu Developer{% endblock %} |
| 217 | |
| 218 | {% block breadcrumbs %} |
| 219 | {% endblock %} |
| 220 | |
| 221 | {% block content %} |
| 222 | -{% if version.id %} |
| 223 | -<h2>Edit {{version.name}}</h2> |
| 224 | -{% else %} |
| 225 | +<div class="row"> |
| 226 | <h2>New Version</h2> |
| 227 | -{% endif %} |
| 228 | - |
| 229 | -<form action="" method="POST" id="element_form"> |
| 230 | -{% csrf_token %} |
| 231 | -{{ form.as_p }} |
| 232 | -<input type="submit" value="Save"> |
| 233 | -</form> |
| 234 | - |
| 235 | +<h3>(Previous version: {{ previous.slug }})</h3> |
| 236 | + <div class="six-col"> |
| 237 | + <form action="" method="POST" id="element_form"> |
| 238 | + {% csrf_token %} |
| 239 | + {{ form.as_p }} |
| 240 | + <input type="submit" value="Save"> |
| 241 | + </form> |
| 242 | + </div> |
| 243 | +</div> |
| 244 | {% endblock %} |
| 245 | |
| 246 | === modified file 'api_docs/urls.py' |
| 247 | --- api_docs/urls.py 2015-02-26 15:53:30 +0000 |
| 248 | +++ api_docs/urls.py 2016-02-24 17:45:37 +0000 |
| 249 | @@ -16,6 +16,7 @@ |
| 250 | url(r'^(?P<topic_name>[\w\.-]+)/$', 'api_docs.views.topic_view', name='topic'), |
| 251 | url(r'^(?P<topic_name>[\w\.-]+)/(?P<language_name>[\w\.-]+)/$', 'api_docs.views.language_view', name='language'), |
| 252 | url(r'^(?P<topic_name>[\w\.-]+)/(?P<language_name>[\w\.-]+)/(?P<release_version>[\w\.-]+)/$', 'api_docs.views.version_view', name='version'), |
| 253 | + url(r'^(?P<topic_name>[\w\.-]+)/(?P<language_name>[\w\.-]+)/\+release/$', 'api_docs.views.release_version', name='release_version'), |
| 254 | url(r'^(?P<topic_name>[\w\.-]+)/(?P<language_name>[\w\.-]+)/(?P<release_version>[\w\.-]+)/(?P<element_fullname>[\w\.\-\:]+)/$', 'api_docs.views.element_view', name='element'), |
| 255 | |
| 256 | ) |
| 257 | |
| 258 | === modified file 'api_docs/views.py' |
| 259 | --- api_docs/views.py 2015-03-27 21:00:43 +0000 |
| 260 | +++ api_docs/views.py 2016-02-24 17:45:37 +0000 |
| 261 | @@ -52,6 +52,38 @@ |
| 262 | } |
| 263 | return render_to_response('api_docs/language.html', context, RequestContext(request)) |
| 264 | |
| 265 | +from django.forms import ModelForm |
| 266 | +class VersionForm(ModelForm): |
| 267 | + class Meta: |
| 268 | + model = Version |
| 269 | + fields = ['name', 'slug'] |
| 270 | + |
| 271 | +def release_version(request, topic_name, language_name): |
| 272 | + language = get_object_or_404(Language, topic__slug=topic_name, slug=language_name) |
| 273 | + |
| 274 | + version = Version(language=language) |
| 275 | + |
| 276 | + if request.method == 'POST': |
| 277 | + form = VersionForm(request.POST, instance=version) |
| 278 | + if form.is_valid(): |
| 279 | + form.save() |
| 280 | + language.current_version = language.development_version |
| 281 | + language.development_version = version |
| 282 | + language.save() |
| 283 | + version.import_from(language.current_version) |
| 284 | + version.save() |
| 285 | + return HttpResponseRedirect(reverse('api_docs:version', args=[topic_name, language_name, version.slug])) |
| 286 | + else: |
| 287 | + form = VersionForm(instance=version) |
| 288 | + |
| 289 | + context = { |
| 290 | + 'form': form, |
| 291 | + 'topic': language.topic, |
| 292 | + 'language': language, |
| 293 | + 'version': version, |
| 294 | + 'previous': language.development_version, |
| 295 | + } |
| 296 | + return render_to_response('api_docs/version_edit.html', context, RequestContext(request)) |
| 297 | |
| 298 | def version_view(request, topic_name, language_name, release_version): |
| 299 | version = _get_release_version(topic_name, language_name, release_version) |
| 300 | |
| 301 | === modified file 'update_apidocs.sh' |
| 302 | --- update_apidocs.sh 2016-01-11 15:33:54 +0000 |
| 303 | +++ update_apidocs.sh 2016-02-24 17:45:37 +0000 |
| 304 | @@ -2,113 +2,112 @@ |
| 305 | |
| 306 | mkdir -p /tmp/apidoc_sources/ |
| 307 | |
| 308 | -##### SDK 15.04.1 |
| 309 | # Archives to download packages from |
| 310 | export SERIES="vivid" |
| 311 | |
| 312 | #### Apps/QML |
| 313 | ## QtQML & QtQuick |
| 314 | ./get_package.py qtdeclarative5-doc-html |
| 315 | -python manage.py import_qdoc -p -t apps -l qml -r sdk-15.04.1 -s "Language Types" -N QtQml -i /tmp/apidoc_sources/usr/share/qt5/doc/qtqml/qtqml.index |
| 316 | -python manage.py import_qdoc -p -t apps -l qml -r sdk-15.04.1 -s "Graphical Interface" -n QtQuick -i /tmp/apidoc_sources/usr/share/qt5/doc/qtquick/qtquick.index |
| 317 | +python manage.py import_qdoc -p -t apps -l qml -r development -s "Language Types" -N QtQml -i /tmp/apidoc_sources/usr/share/qt5/doc/qtqml/qtqml.index |
| 318 | +python manage.py import_qdoc -p -t apps -l qml -r development -s "Graphical Interface" -n QtQuick -i /tmp/apidoc_sources/usr/share/qt5/doc/qtquick/qtquick.index |
| 319 | |
| 320 | ## QtMultimedia & QtAudioEngine |
| 321 | ./get_package.py qtmultimedia5-doc-html |
| 322 | -python manage.py import_qdoc -p -t apps -l qml -r sdk-15.04.1 -s "Multimedia" -n QtMultimedia -i /tmp/apidoc_sources/usr/share/qt5/doc/qtmultimedia/qtmultimedia.index |
| 323 | +python manage.py import_qdoc -p -t apps -l qml -r development -s "Multimedia" -n QtMultimedia -i /tmp/apidoc_sources/usr/share/qt5/doc/qtmultimedia/qtmultimedia.index |
| 324 | |
| 325 | ## QtSensors |
| 326 | ./get_package.py qtsensors5-doc-html |
| 327 | -python manage.py import_qdoc -p -t apps -l qml -r sdk-15.04.1 -s "Device and Sensors" -n QtSensors -i /tmp/apidoc_sources/usr/share/qt5/doc/qtsensors/qtsensors.index |
| 328 | +python manage.py import_qdoc -p -t apps -l qml -r development -s "Device and Sensors" -n QtSensors -i /tmp/apidoc_sources/usr/share/qt5/doc/qtsensors/qtsensors.index |
| 329 | |
| 330 | ## QtFeedback |
| 331 | ./get_package.py qtfeedback5-doc-html |
| 332 | -python manage.py import_qdoc -t apps -l qml -r sdk-15.04.1 -s "Device and Sensors" -n QtFeedback -i /tmp/apidoc_sources/usr/share/qt5/doc/qtfeedback/qtfeedback.index |
| 333 | +python manage.py import_qdoc -t apps -l qml -r development -s "Device and Sensors" -n QtFeedback -i /tmp/apidoc_sources/usr/share/qt5/doc/qtfeedback/qtfeedback.index |
| 334 | |
| 335 | ## QtLocation |
| 336 | ./get_package.py qtlocation5-doc-html |
| 337 | -python manage.py import_qdoc -p -t apps -l qml -r sdk-15.04.1 -s "Platform Services" -i /tmp/apidoc_sources/usr/share/qt5/doc/qtlocation/qtlocation.index |
| 338 | +python manage.py import_qdoc -p -t apps -l qml -r development.1 -s "Platform Services" -i /tmp/apidoc_sources/usr/share/qt5/doc/qtlocation/qtlocation.index |
| 339 | |
| 340 | ## QtOrganizer |
| 341 | ./get_package.py qtpim5-doc-html |
| 342 | -python manage.py import_qdoc -t apps -l qml -r sdk-15.04.1 -s "Platform Services" -i /tmp/apidoc_sources/usr/share/qt5/doc/qtorganizer/qtorganizer.index |
| 343 | -python manage.py import_qdoc -t apps -l qml -r sdk-15.04.1 -s "Platform Services" -i /tmp/apidoc_sources/usr/share/qt5/doc/qtcontacts/qtcontacts.index |
| 344 | +python manage.py import_qdoc -t apps -l qml -r development -s "Platform Services" -i /tmp/apidoc_sources/usr/share/qt5/doc/qtorganizer/qtorganizer.index |
| 345 | +python manage.py import_qdoc -t apps -l qml -r development -s "Platform Services" -i /tmp/apidoc_sources/usr/share/qt5/doc/qtcontacts/qtcontacts.index |
| 346 | |
| 347 | ## Ubuntu.Components |
| 348 | ./get_package.py ubuntu-ui-toolkit-doc |
| 349 | -python manage.py import_qdoc -Pp -t apps -l qml -r sdk-15.04.1 -s "Graphical Interface" -n Ubuntu.Components -i /tmp/apidoc_sources/usr/share/ubuntu-ui-toolkit/doc/html/ubuntuuserinterfacetoolkit.index |
| 350 | +python manage.py import_qdoc -Pp -t apps -l qml -r development -s "Graphical Interface" -n Ubuntu.Components -i /tmp/apidoc_sources/usr/share/ubuntu-ui-toolkit/doc/html/ubuntuuserinterfacetoolkit.index |
| 351 | |
| 352 | ## Ubuntu.OnlineAccounts |
| 353 | ./get_package.py accounts-qml-module-doc |
| 354 | -python manage.py import_qdoc -Pp -t apps -l qml -r sdk-15.04.1 -s "Platform Services" -N Ubuntu.OnlineAccounts -i /tmp/apidoc_sources/usr/share/accounts-qml-module/doc/html/onlineaccounts-qml-api.index |
| 355 | +python manage.py import_qdoc -Pp -t apps -l qml -r development -s "Platform Services" -N Ubuntu.OnlineAccounts -i /tmp/apidoc_sources/usr/share/accounts-qml-module/doc/html/onlineaccounts-qml-api.index |
| 356 | |
| 357 | ## Ubuntu.Content |
| 358 | ./get_package.py libcontent-hub-doc |
| 359 | gunzip -f /tmp/apidoc_sources/usr/share/doc/content-hub/qml/html/ubuntu-content-qml-api.index.gz |
| 360 | -python manage.py import_qdoc -Pp -t apps -l qml -r sdk-15.04.1 -s "Platform Services" -N Ubuntu.Content -i /tmp/apidoc_sources/usr/share/doc/content-hub/qml/html/ubuntu-content-qml-api.index |
| 361 | +python manage.py import_qdoc -Pp -t apps -l qml -r development -s "Platform Services" -N Ubuntu.Content -i /tmp/apidoc_sources/usr/share/doc/content-hub/qml/html/ubuntu-content-qml-api.index |
| 362 | |
| 363 | # U1db |
| 364 | ./get_package.py libu1db-qt5-doc |
| 365 | -python manage.py import_qdoc -p -t apps -l qml -r sdk-15.04.1 -s "Platform Services" -N U1db -i /tmp/apidoc_sources/usr/share/u1db-qt/doc/html/u1db-qt.index |
| 366 | +python manage.py import_qdoc -p -t apps -l qml -r development -s "Platform Services" -N U1db -i /tmp/apidoc_sources/usr/share/u1db-qt/doc/html/u1db-qt.index |
| 367 | |
| 368 | ## Ubuntu.DownloadManager |
| 369 | ./get_package.py libubuntu-download-manager-client-doc |
| 370 | gunzip -f /tmp/apidoc_sources/usr/share/doc/ubuntu-download-manager/qml/html/ubuntu-download-manager-qml-api.index.gz |
| 371 | -python manage.py import_qdoc -Pp -t apps -l qml -r sdk-15.04.1 -s "Platform Services" -N Ubuntu.DownloadManager -i /tmp/apidoc_sources/usr/share/doc/ubuntu-download-manager/qml/html/ubuntu-download-manager-qml-api.index |
| 372 | +python manage.py import_qdoc -Pp -t apps -l qml -r development -s "Platform Services" -N Ubuntu.DownloadManager -i /tmp/apidoc_sources/usr/share/doc/ubuntu-download-manager/qml/html/ubuntu-download-manager-qml-api.index |
| 373 | |
| 374 | ## Ubuntu.Web |
| 375 | ./get_package.py qtdeclarative5-ubuntu-web-plugin-doc |
| 376 | gunzip -f /tmp/apidoc_sources/usr/share/doc/ubuntu-web/html/ubuntuweb.index.gz |
| 377 | -python manage.py import_qdoc -Pp -t apps -l qml -r sdk-15.04.1 -s "Graphical Interface" -N Ubuntu.Web -i /tmp/apidoc_sources/usr/share/doc/ubuntu-web/html/ubuntuweb.index |
| 378 | +python manage.py import_qdoc -Pp -t apps -l qml -r development -s "Graphical Interface" -N Ubuntu.Web -i /tmp/apidoc_sources/usr/share/doc/ubuntu-web/html/ubuntuweb.index |
| 379 | |
| 380 | ## Ubuntu.Connectivity |
| 381 | ./get_package.py connectivity-doc |
| 382 | -python manage.py import_qdoc -Pp -t apps -l qml -r sdk-15.04.1 -s "Platform Services" -N Ubuntu.Connectivity -i /tmp/apidoc_sources/usr/share/doc/connectivity-api/qml/html/connectivity.index |
| 383 | +python manage.py import_qdoc -Pp -t apps -l qml -r development -s "Platform Services" -N Ubuntu.Connectivity -i /tmp/apidoc_sources/usr/share/doc/connectivity-api/qml/html/connectivity.index |
| 384 | |
| 385 | #### Aps/HTML5 |
| 386 | ## UbuntuUI |
| 387 | ./get_package.py ubuntu-html5-ui-toolkit-doc |
| 388 | -python manage.py import_yuidoc -i -t apps -l html5 -r sdk-15.04.1 -s "Graphical Interface" -d /tmp/apidoc_sources/usr/share/doc/ubuntu-html5-ui-toolkit-doc/data.json |
| 389 | +python manage.py import_yuidoc -i -t apps -l html5 -r development -s "Graphical Interface" -d /tmp/apidoc_sources/usr/share/doc/ubuntu-html5-ui-toolkit-doc/data.json |
| 390 | |
| 391 | ## Platform Bindings |
| 392 | ./get_package.py unity-webapps-qml-doc |
| 393 | ## OnlineAccounts3 |
| 394 | -python manage.py import_yuidoc -t apps -l html5 -r sdk-15.04.1 -s "Platform Services" -d /tmp/apidoc_sources/usr/share/unity-webapps-qml/doc/api/online-accounts/data.json |
| 395 | +python manage.py import_yuidoc -t apps -l html5 -r development -s "Platform Services" -d /tmp/apidoc_sources/usr/share/unity-webapps-qml/doc/api/online-accounts/data.json |
| 396 | ## AlarmAPI |
| 397 | -python manage.py import_yuidoc -t apps -l html5 -r sdk-15.04.1 -s "Platform Services" -d /tmp/apidoc_sources/usr/share/unity-webapps-qml/doc/api/alarm-api/data.json |
| 398 | +python manage.py import_yuidoc -t apps -l html5 -r development -s "Platform Services" -d /tmp/apidoc_sources/usr/share/unity-webapps-qml/doc/api/alarm-api/data.json |
| 399 | ## ContentHub |
| 400 | -python manage.py import_yuidoc -t apps -l html5 -r sdk-15.04.1 -s "Platform Services" -d /tmp/apidoc_sources/usr/share/unity-webapps-qml/doc/api/content-hub/data.json |
| 401 | +python manage.py import_yuidoc -t apps -l html5 -r development -s "Platform Services" -d /tmp/apidoc_sources/usr/share/unity-webapps-qml/doc/api/content-hub/data.json |
| 402 | ## RuntimeAPI |
| 403 | -python manage.py import_yuidoc -t apps -l html5 -r sdk-15.04.1 -s "Platform Services" -d /tmp/apidoc_sources/usr/share/unity-webapps-qml/doc/api/runtime-api/data.json |
| 404 | +python manage.py import_yuidoc -t apps -l html5 -r development -s "Platform Services" -d /tmp/apidoc_sources/usr/share/unity-webapps-qml/doc/api/runtime-api/data.json |
| 405 | |
| 406 | #### Autopilot/Python |
| 407 | ## Autopilot |
| 408 | ./get_package.py python3-autopilot |
| 409 | find /tmp/apidoc_sources/usr/share/doc/python3-autopilot/json/ -name "*.gz" -print0 |xargs -0 gunzip |
| 410 | -python manage.py import_sphinx -t autopilot -l python -r 1.5.0 -s ./api_docs/importers/autopilot_sections.py -i /tmp/apidoc_sources/usr/share/doc/python3-autopilot/json/objects.inv |
| 411 | +python manage.py import_sphinx -t autopilot -l python -r development -s ./api_docs/importers/autopilot_sections.py -i /tmp/apidoc_sources/usr/share/doc/python3-autopilot/json/objects.inv |
| 412 | |
| 413 | ./get_package.py ubuntu-ui-toolkit-autopilot |
| 414 | find /tmp/apidoc_sources/usr/share/doc/ubuntu-ui-toolkit-autopilot/json/ -name "*.gz" -print0 |xargs -0 gunzip |
| 415 | -python manage.py import_sphinx -t autopilot -l python -r 1.5.0 -s ./api_docs/importers/autopilot_sections.py -i /tmp/apidoc_sources/usr/share/doc/ubuntu-ui-toolkit-autopilot/json/objects.inv |
| 416 | +python manage.py import_sphinx -t autopilot -l python -r development -s ./api_docs/importers/autopilot_sections.py -i /tmp/apidoc_sources/usr/share/doc/ubuntu-ui-toolkit-autopilot/json/objects.inv |
| 417 | |
| 418 | ./get_package.py python3-scope-harness |
| 419 | find /tmp/apidoc_sources/usr/share/doc/python3-scope-harness/json/ -name "*.gz" -print0 |xargs -0 gunzip |
| 420 | -python manage.py import_sphinx -t autopilot -l python -r 1.5.0 -s ./api_docs/importers/autopilot_sections.py -i /tmp/apidoc_sources/usr/share/doc/python3-scope-harness/json/objects.inv |
| 421 | +python manage.py import_sphinx -t autopilot -l python -r development -s ./api_docs/importers/autopilot_sections.py -i /tmp/apidoc_sources/usr/share/doc/python3-scope-harness/json/objects.inv |
| 422 | |
| 423 | #### Scopes/C++ |
| 424 | ## unity.scopes |
| 425 | ./get_package.py libunity-scopes-doc |
| 426 | -python manage.py import_doxygen -t scopes -l cpp -r sdk-15.04.1 -s ./api_docs/importers/scope_sections.py -N unity.scopes -d /tmp/apidoc_sources/usr/share/doc/unity-scopes/ |
| 427 | +python manage.py import_doxygen -t scopes -l cpp -r development -s ./api_docs/importers/scope_sections.py -N unity.scopes -d /tmp/apidoc_sources/usr/share/doc/unity-scopes/ |
| 428 | |
| 429 | ## Accounts |
| 430 | ./get_package.py libaccounts-qt-doc |
| 431 | -python manage.py import_doxygen -t scopes -l cpp -r sdk-15.04.1 -s ./api_docs/importers/accounts_sections.py -n Accounts -d /tmp/apidoc_sources/usr/share/doc/libaccounts-qt/html/ |
| 432 | +python manage.py import_doxygen -t scopes -l cpp -r development -s ./api_docs/importers/accounts_sections.py -n Accounts -d /tmp/apidoc_sources/usr/share/doc/libaccounts-qt/html/ |
| 433 | |
| 434 | ## U1db |
| 435 | ./get_package.py libu1db-qt5-doc |
| 436 | -python manage.py import_qdoc -Pp -N U1db -t scopes -l cpp -r sdk-15.04.1 -s "Platform Services" -i /tmp/apidoc_sources/usr/share/u1db-qt/doc/html/u1db-qt.index |
| 437 | +python manage.py import_qdoc -Pp -N U1db -t scopes -l cpp -r development -s "Platform Services" -i /tmp/apidoc_sources/usr/share/u1db-qt/doc/html/u1db-qt.index |
| 438 | |
| 439 | #### Scopes/Javascript |
| 440 | SOURCE=http://ppa.launchpad.net/ubuntu-sdk-team/ppa/ubuntu ./get_package.py unity-js-scopes-doc |
| 441 | -python manage.py import_yuidoc -t scopes -l js -r sdk-15.04.1 -s "Platform Services" -d /tmp/apidoc_sources/usr/share/unity-js-scopes/doc/docbuild/data.json |
| 442 | +python manage.py import_yuidoc -t scopes -l js -r development -s "Platform Services" -d /tmp/apidoc_sources/usr/share/unity-js-scopes/doc/docbuild/data.json |
| 443 | |
| 444 | rm -r /tmp/apidoc_sources/ |


To test, you will need existing API docs with a version marked as the "development" version for a language. Then log in using an account with admin access and navigate to that version's page, you should see a link in the upper-right marked "New Release". Clicking that will take you to a page where you can define the name of the new version, and submitting that will copy the contents from the previous "development" version into the new one, mark the old one as "current" and the new one as "development"