From fa5ac720d73b9f88aee989ac635cbdf598f955ce Mon Sep 17 00:00:00 2001 From: gabriel Date: Wed, 24 Apr 2024 19:25:02 -0300 Subject: [PATCH] Alterando o css do mkdocs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Foi alterado o tamanho do ícone e alguns elementos visuais do header através do extra.css --- .gitignore | 2 ++ conversor_pdf_json/conversor_pdf_json.py | 28 ++++++++++++++++++++++++ docs/assets/stylesheets/extra.css | 15 +++++++++++++ mkdocs.yml | 4 ++-- 4 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 .gitignore create mode 100644 conversor_pdf_json/conversor_pdf_json.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2f3a397 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +venv +webscrapy \ No newline at end of file diff --git a/conversor_pdf_json/conversor_pdf_json.py b/conversor_pdf_json/conversor_pdf_json.py new file mode 100644 index 0000000..526dfa6 --- /dev/null +++ b/conversor_pdf_json/conversor_pdf_json.py @@ -0,0 +1,28 @@ +from urllib.request import Request, urlopen +from PyPDF2 import PdfFileReader +import io + +# Url aleatória somente para teste +url = '' + +# Chamando funções para extrair o pdf +remote_file = urlopen(Request(url)).read() +memory_file = io.BytesIO(remote_file) +pdf = PdfFileReader(memory_file) + +# Gerando arquivo .json sem baixa o pdf no seu computador +with open('amem2.json', 'w', encoding="utf-8") as d: + for page_num in range(pdf.numPages): + print('page: {0}'.format(page_num+1)) + pageObj = pdf.getPage(page_num) + + try: + json = pageObj.extractText() + print(''.center(100,'-')) + except: + pass + else: + d.write('page{0}\n0'.format(page_num+1)) + d.write(''.center(100, '-')) + d.write(json) + d.close() \ No newline at end of file diff --git a/docs/assets/stylesheets/extra.css b/docs/assets/stylesheets/extra.css index e69de29..ce904f9 100644 --- a/docs/assets/stylesheets/extra.css +++ b/docs/assets/stylesheets/extra.css @@ -0,0 +1,15 @@ + + /* logo */ +.md-header__button.md-logo img, +.md-header__button.md-logo svg { + height: 3rem; + width: 3rem; + } +.md-header__button.md-logo { + margin-top: 1; + margin-bottom: 0; + padding-top: 0; + padding-bottom: 0; + } + +.md-tabs__link {color: black;} diff --git a/mkdocs.yml b/mkdocs.yml index 11923da..fc31481 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -1,10 +1,10 @@ -site_name: Squad 07 +site_name: MINAS DE CULTURA extra_css: - assets/stylesheets/extra.css theme: favicon: assets/images/favicon.png - logo: assets/images/favicon.png + logo: assets/images/logo_branca.png name: material features: - navigation.tabs