Skip to content

Commit

Permalink
doc(nyz): fix diagrams generation problem when use read-docs service
Browse files Browse the repository at this point in the history
  • Loading branch information
PaParaZz1 committed Jul 10, 2021
1 parent 0a16385 commit 8f5b723
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
*.eps
*.jpg
*.svg
.DS_Store
5 changes: 3 additions & 2 deletions diagrams.mk
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@ SVGS := $(addsuffix .puml.svg, $(basename ${PUMLS}))
%.puml.svg: %.puml
$(PLANTUMLCLI) -t svg -o $@ $<

build: ${PNGS} ${EPSS} ${SVGS}
build: ${SVGS}

all: build

clean:
rm -rf \
$(shell find ${SOURCE} -name *.puml.svg)

$(shell find ${SOURCE} -name *.puml.png) \
$(shell find ${SOURCE} -name *.puml.eps) \
4 changes: 4 additions & 0 deletions source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@

sys.path.insert(0, os.path.abspath('../../'))
print(sys.path)
f = os.popen('make -f diagrams_source.mk')
for item in f.readlines():
print(f)
print('diagrams is OK')
# -- Project information -----------------------------------------------------

project = 'DI-engine'
Expand Down
27 changes: 27 additions & 0 deletions source/diagrams_source.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
PLANTUMLCLI := $(shell which plantumlcli)


SOURCE := .
PUMLS := $(shell find ${SOURCE} -name *.puml)
PNGS := $(addsuffix .puml.png, $(basename ${PUMLS}))
EPSS := $(addsuffix .puml.eps, $(basename ${PUMLS}))
SVGS := $(addsuffix .puml.svg, $(basename ${PUMLS}))

%.puml.png: %.puml
$(PLANTUMLCLI) -t png -o $@ $<

%.puml.eps: %.puml
$(PLANTUMLCLI) -t eps -o $@ $<

%.puml.svg: %.puml
$(PLANTUMLCLI) -t svg -o $@ $<

build: ${SVGS}

all: build

clean:
rm -rf \
$(shell find ${SOURCE} -name *.puml.svg)
$(shell find ${SOURCE} -name *.puml.png) \
$(shell find ${SOURCE} -name *.puml.eps) \

0 comments on commit 8f5b723

Please sign in to comment.