mirror of
https://github.com/Lerking/md2doc.git
synced 2025-07-21 04:01:14 +02:00
Updated. /JL
This commit is contained in:
35
README.md
35
README.md
@@ -1,30 +1,31 @@
|
||||
# Python repo template
|
||||
[](https://GitHub.com/Lerking/python-repo-template/forks/)
|
||||
[](https://GitHub.com/Lerking/python-repo-template/stargazers/)
|
||||
[](https://GitHub.com/Lerking/python-repo-template/watchers/)
|
||||
# md2doc
|
||||
A small utility to convert md files into doc files.
|
||||
[](https://GitHub.com/Lerking/md2doc/forks/)
|
||||
[](https://GitHub.com/Lerking/md2doc/stargazers/)
|
||||
[](https://GitHub.com/Lerking/md2doc/watchers/)
|
||||
|
||||
[](https://www.python.org/)
|
||||
|
||||
[](https://github.com/Lerking/python-repo-template)
|
||||
[](https://github.com/Lerking/md2doc)
|
||||
|
||||
[](https://GitHub.com/Lerking/python-repo-template.github.io/graphs/commit-activity)
|
||||
[](https://GitHub.com/Lerking/python-repo-template/graphs/contributors/)
|
||||
[](https://GitHub.com/Lerking/md2doc.github.io/graphs/commit-activity)
|
||||
[](https://GitHub.com/Lerking/md2doc/graphs/contributors/)
|
||||
|
||||
[]()
|
||||
[]()
|
||||
|
||||
[](https://GitHub.com/Lerking/python-repo-template/issues/)
|
||||
[](https://GitHub.com/Lerking/python-repo-template/issues?q=is%3Aissue+is%3Aclosed)
|
||||
[](http://isitmaintained.com/project/Lerking/python-repo-template "Percentage of issues still open")
|
||||
[](http://isitmaintained.com/project/Lerking/python-repo-template "Average time to resolve an issue")
|
||||
[](https://GitHub.com/Lerking/md2doc/issues/)
|
||||
[](https://GitHub.com/Lerking/md2doc/issues?q=is%3Aissue+is%3Aclosed)
|
||||
[](http://isitmaintained.com/project/Lerking/md2doc "Percentage of issues still open")
|
||||
[](http://isitmaintained.com/project/Lerking/md2doc "Average time to resolve an issue")
|
||||
|
||||
[](https://GitHub.com/Lerking/python-repo-template/pull)
|
||||
[](https://GitHub.com/Lerking/python-repo-template/pull)
|
||||
[](https://GitHub.com/Lerking/md2doc/pull)
|
||||
[](https://GitHub.com/Lerking/md2doc/pull)
|
||||
|
||||
Coding time for this reposotory.</br>
|
||||
[](https://wakatime.com/badge/user/d43f2852-fd6f-45b4-b713-558ad18204d4/project/dcf411f9-6d3e-4b14-9290-5ed419cf4012)
|
||||
[](https://wakatime.com/badge/user/d43f2852-fd6f-45b4-b713-558ad18204d4/project/7d720253-677f-4922-bf52-9a9575ee14e6)
|
||||
|
||||
See the wiki for usage and examples.
|
||||
[python-repo-template wiki page](https://github.com/Lerking/python-repo-template/wiki)
|
||||
[md2doc wiki page](https://github.com/Lerking/md2doc/wiki)
|
||||
|
||||
Visitors since repo creation.</br>
|
||||

|
||||

|
18
main.py
18
main.py
@@ -0,0 +1,18 @@
|
||||
import markdown
|
||||
from docx import Document
|
||||
from htmldocx import HtmlToDocx
|
||||
|
||||
def read_md():
|
||||
with open('./test-data/markdown_sample.md', 'r') as f:
|
||||
text = f.read()
|
||||
return markdown.markdown(text)
|
||||
|
||||
def write_doc(text):
|
||||
doc = Document()
|
||||
parser = HtmlToDocx()
|
||||
parser.add_html_to_document(text, doc)
|
||||
|
||||
doc.save("./test-data/markdown_sample.docx")
|
||||
|
||||
if __name__=="__main__":
|
||||
write_doc(read_md())
|
BIN
test-data/markdown_sample.docx
Normal file
BIN
test-data/markdown_sample.docx
Normal file
Binary file not shown.
154
test-data/markdown_sample.md
Normal file
154
test-data/markdown_sample.md
Normal file
@@ -0,0 +1,154 @@
|
||||
An h1 header
|
||||
============
|
||||
|
||||
Paragraphs are separated by a blank line.
|
||||
|
||||
2nd paragraph. *Italic*, **bold**, and `monospace`. Itemized lists
|
||||
look like:
|
||||
|
||||
* this one
|
||||
* that one
|
||||
* the other one
|
||||
|
||||
Note that --- not considering the asterisk --- the actual text
|
||||
content starts at 4-columns in.
|
||||
|
||||
> Block quotes are
|
||||
> written like so.
|
||||
>
|
||||
> They can span multiple paragraphs,
|
||||
> if you like.
|
||||
|
||||
Use 3 dashes for an em-dash. Use 2 dashes for ranges (ex., "it's all
|
||||
in chapters 12--14"). Three dots ... will be converted to an ellipsis.
|
||||
Unicode is supported. ☺
|
||||
|
||||
|
||||
|
||||
An h2 header
|
||||
------------
|
||||
|
||||
Here's a numbered list:
|
||||
|
||||
1. first item
|
||||
2. second item
|
||||
3. third item
|
||||
|
||||
Note again how the actual text starts at 4 columns in (4 characters
|
||||
from the left side). Here's a code sample:
|
||||
|
||||
# Let me re-iterate ...
|
||||
for i in 1 .. 10 { do-something(i) }
|
||||
|
||||
As you probably guessed, indented 4 spaces. By the way, instead of
|
||||
indenting the block, you can use delimited blocks, if you like:
|
||||
|
||||
```
|
||||
define foobar() {
|
||||
print "Welcome to flavor country!";
|
||||
}
|
||||
```
|
||||
|
||||
(which makes copying & pasting easier). You can optionally mark the
|
||||
delimited block for Pandoc to syntax highlight it:
|
||||
|
||||
```python
|
||||
import time
|
||||
# Quick, count to ten!
|
||||
for i in range(10):
|
||||
# (but not *too* quick)
|
||||
time.sleep(0.5)
|
||||
print i
|
||||
```
|
||||
|
||||
|
||||
|
||||
### An h3 header ###
|
||||
|
||||
Now a nested list:
|
||||
|
||||
1. First, get these ingredients:
|
||||
|
||||
* carrots
|
||||
* celery
|
||||
* lentils
|
||||
|
||||
2. Boil some water.
|
||||
|
||||
3. Dump everything in the pot and follow
|
||||
this algorithm:
|
||||
|
||||
find wooden spoon
|
||||
uncover pot
|
||||
stir
|
||||
cover pot
|
||||
balance wooden spoon precariously on pot handle
|
||||
wait 10 minutes
|
||||
goto first step (or shut off burner when done)
|
||||
|
||||
Do not bump wooden spoon or it will fall.
|
||||
|
||||
Notice again how text always lines up on 4-space indents (including
|
||||
that last line which continues item 3 above).
|
||||
|
||||
Here's a link to [a website](http://foo.bar), to a [local
|
||||
doc](local-doc.html), and to a [section heading in the current
|
||||
doc](#an-h2-header). Here's a footnote [^1].
|
||||
|
||||
[^1]: Footnote text goes here.
|
||||
|
||||
Tables can look like this:
|
||||
|
||||
size | material | color
|
||||
--- | --- | ---
|
||||
9 | leather | brown
|
||||
10 | hemp canvas | natural
|
||||
11 | glass | transparent
|
||||
|
||||
Table: Shoes, their sizes, and what they're made of
|
||||
|
||||
(The above is the caption for the table.) Pandoc also supports
|
||||
multi-line tables:
|
||||
|
||||
---
|
||||
keyword | text
|
||||
--- | ---
|
||||
red | Sunsets, apples, and</br>other red or reddish</br>things.
|
||||
green | Leaves, grass, frogs</br>and other things it's</br>not easy being.
|
||||
|
||||
|
||||
A horizontal rule follows.
|
||||
|
||||
***
|
||||
|
||||
Here's a definition list:
|
||||
|
||||
apples
|
||||
: Good for making applesauce.
|
||||
|
||||
oranges
|
||||
: Citrus!
|
||||
|
||||
tomatoes
|
||||
: There's no "e" in tomatoe.
|
||||
|
||||
Again, text is indented 4 spaces. (Put a blank line between each
|
||||
term/definition pair to spread things out more.)
|
||||
|
||||
Here's a "line block":
|
||||
|
||||
| Line one
|
||||
| Line too
|
||||
| Line tree
|
||||
|
||||
and images can be specified like so:
|
||||
|
||||

|
||||
|
||||
Inline math equations go in like so: $\omega = d\phi / dt$. Display
|
||||
math should get its own line and be put in in double-dollarsigns:
|
||||
|
||||
$$I = \int \rho R^{2} dV$$
|
||||
|
||||
And note that you can backslash-escape any punctuation characters
|
||||
which you wish to be displayed literally, ex.: \`foo\`, \*bar\*, etc.
|
52
test-data/revise_mv.md
Normal file
52
test-data/revise_mv.md
Normal file
@@ -0,0 +1,52 @@
|
||||
# Revising module variants.
|
||||
|
||||
1. [Open reference document](#open-reference-document)
|
||||
2. [Update econfig repository](#update-econfig-repository)
|
||||
3. [Revise module variant](#revise-module-variant)
|
||||
4. [Check in changes in econfig repository](#check-in-changes-in-econfig-repository)
|
||||
5. [Import and verify updates in TeamCenter](#import-and-verify-updates-in-teamcenter)
|
||||
6. [Update models.decanter repository](#update-models-decanter-repository)
|
||||
7. [Sign off ECN for review](#sign-off-ecn-for-review)
|
||||
8. [Complete ECN](#complete-ecn)
|
||||
### Open reference document
|
||||
Open the reference excel document from TeamCenter.
|
||||
|
||||
Check that the MVs to be revised matches the MVs in the Impacted folder.
|
||||
If there are inconsistencies, contact design engineer to have the reference excel document and/or the Impacted folder updated.
|
||||
|
||||
### Update econfig repository
|
||||
Switch to the ALiCE.econfig.Decanter repository and make sure the __master__ branch is checked out.
|
||||
|
||||
Update local files.
|
||||
|
||||
### Revise module variant
|
||||
Either update the MVs directly in TCStudio or using the Excel plugin.
|
||||
|
||||
If new domain values are needed, also make sure to add them in eDecanter_domains.tcx
|
||||
|
||||
### Check in changes to econfig repository
|
||||
Once the MVs have been updated, check in the changes in Visual Studio.
|
||||
|
||||
Copy the SHA ID for your check in.
|
||||
|
||||
### Import and verify updates in Teamcenter
|
||||
Run the "Import Product Class" workflow.
|
||||
|
||||
Once finished, check that new MV revisions have been created in the 'Results' folder and the MVs have all been updated according to the reference excel sheet.
|
||||
|
||||
### Update models decanter repository
|
||||
Check out the Next_release_Dev branch.
|
||||
|
||||
Update local files.
|
||||
|
||||
Copy updated module file from ALiCE.econfig.Decanter/master branch into ALiCE.models.Decanter/Next_release_Dev branch.
|
||||
If needed update eDecanter_domains.tcx as well.
|
||||
|
||||
Deploy module to ALiCE module files.
|
||||
|
||||
### Sign off ECN for review
|
||||
'Perform' ECN and enter module engineers name for review.
|
||||
The ECN will now be sent to the module engineers work folder.
|
||||
|
||||
### Complete ECN
|
||||
When review has been done, 'Perform' the ECN and select 'Complete'
|
Reference in New Issue
Block a user