Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions config/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
"reference",
"xml_manager",
"model_ai",
"markup_doc",
]

INSTALLED_APPS = DJANGO_APPS + THIRD_PARTY_APPS + LOCAL_APPS + WAGTAIL
Expand Down
Binary file added fixtures/Artigo 5.docx
Binary file not shown.
Binary file added fixtures/e14790.docx
Binary file not shown.
Binary file added fixtures/e740.docx
Binary file not shown.
Empty file added markup_doc/__init__.py
Empty file.
3 changes: 3 additions & 0 deletions markup_doc/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.contrib import admin

# Register your models here.
6 changes: 6 additions & 0 deletions markup_doc/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from django.apps import AppConfig


class MarkupDocConfig(AppConfig):
default_auto_field = "django.db.models.BigAutoField"
name = "markup_doc"
121 changes: 121 additions & 0 deletions markup_doc/choices.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
front_labels = [
('<abstract>', '<abstract>'),
('<abstract-title>', '<abstract-title>'),
('<aff>', '<aff>'),
('<article-id>', '<article-id>'),
('<article-title>', '<article-title>'),
('<author-notes>', '<author-notes>'),
('<contrib>', '<contrib>'),
('<date-accepted>', '<date-accepted>'),
('<date-received>', '<date-received>'),
('<fig>', '<fig>'),
('<fig-attrib>', '<fig-attrib>'),
('<history>', '<history>'),
('<kwd-title>', '<kwd-title>'),
('<kwd-group>', '<kwd-group>'),
('<list>', '<list>'),
('<p>', '<p>'),
('<sec>', '<sec>'),
('<sub-sec>', '<sub-sec>'),
('<subject>', '<subject>'),
('<table>', '<table>'),
('<table-foot>', '<table-foot>'),
('<title>', '<title>'),
('<trans-abstract>', '<trans-abstract>'),
('<trans-title>', '<trans-title>'),
('<translate-front>', '<translate-front>'),
('<translate-body>', '<translate-body>'),
('<disp-formula>', '<disp-formula>'),
('<inline-formula>', '<inline-formula>'),
('<formula>', '<formula>'),

]

order_labels = {
'<article-id>':{
'pos' : 1,
'next' : '<subject>'
},
'<subject>':{
'pos' : 2,
'next' : '<article-title>'
},
'<article-title>':{
'pos' : 3,
'next' : '<trans-title>',
'lan' : True
},
'<trans-title>':{
'size' : 14,
'bold' : True,
'lan' : True,
'next' : '<contrib>'
},
'<contrib>':{
'reset' : True,
'size' : 12,
'next' : '<aff>'
},
'<aff>':{
'reset' : True,
'size' : 12,
},
'<abstract>':{
'size' : 12,
'bold' : True,
'lan' : True,
'next' : '<p>'
},
'<p>':{
'size' : 12,
'next' : '<p>',
'repeat' : True
},
'<trans-abstract>':{
'size' : 12,
'bold' : True,
'lan' : True,
'next' : '<p>'
},
'<kwd-group>':{
'size' : 12,
'regex' : r'(?i)(palabra.*clave.*:|keyword.*:)',
},
'<history>':{
'size' : 12,
'regex' : r'\d{2}/\d{2}/\d{4}',
},
'<corresp>':{
'size' : 12,
'regex' : r'[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}'
},
'<sec>':{
'size' : 16,
'bold' : True,
'next' : None
},
'<sub-sec>':{
'size' : 12,
'italic' : True,
'next' : None
},
'<sub-sec-2>':{
'size' : 14,
'bold' : True,
'next' : None
},
}

order_labels_body = {
'<sec>':{
'size' : 16,
'bold' : True,
},
'<sub-sec>':{
'size' : 12,
'italic' : True,
},
'<p>':{
'size' : 12,
},
}
1 change: 1 addition & 0 deletions markup_doc/forms.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from wagtail.admin.forms.models import WagtailAdminModelForm
Copy link

Copilot AI Apr 24, 2026

Choose a reason for hiding this comment

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

markup_doc/forms.py only imports WagtailAdminModelForm but doesn't use or export it, which will trigger flake8 unused-import failures. Either remove this file/import or define the intended form subclass here and use it from the models/viewsets.

Suggested change
from wagtail.admin.forms.models import WagtailAdminModelForm
"""Form definitions for the markup_doc app."""

Copilot uses AI. Check for mistakes.
Loading
Loading