pyeasyphd 0.2.6__tar.gz → 0.2.10__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of pyeasyphd might be problematic. Click here for more details.

Files changed (45) hide show
  1. {pyeasyphd-0.2.6 → pyeasyphd-0.2.10}/PKG-INFO +3 -3
  2. {pyeasyphd-0.2.6 → pyeasyphd-0.2.10}/pyeasyphd/main/pandoc_md_to.py +19 -1
  3. {pyeasyphd-0.2.6 → pyeasyphd-0.2.10}/pyeasyphd/main/python_run_md.py +34 -0
  4. {pyeasyphd-0.2.6 → pyeasyphd-0.2.10}/pyeasyphd/pyeasyphd.sublime-settings +10 -0
  5. {pyeasyphd-0.2.6 → pyeasyphd-0.2.10}/pyeasyphd/scripts/run_article_md.py +7 -1
  6. {pyeasyphd-0.2.6 → pyeasyphd-0.2.10}/pyproject.toml +3 -3
  7. {pyeasyphd-0.2.6 → pyeasyphd-0.2.10}/LICENSE +0 -0
  8. {pyeasyphd-0.2.6 → pyeasyphd-0.2.10}/README.md +0 -0
  9. {pyeasyphd-0.2.6 → pyeasyphd-0.2.10}/pyeasyphd/.python-version +0 -0
  10. {pyeasyphd-0.2.6 → pyeasyphd-0.2.10}/pyeasyphd/Main.sublime-menu +0 -0
  11. {pyeasyphd-0.2.6 → pyeasyphd-0.2.10}/pyeasyphd/__init__.py +0 -0
  12. {pyeasyphd-0.2.6 → pyeasyphd-0.2.10}/pyeasyphd/data/Templates/CSL/apa-no-ampersand.csl +0 -0
  13. {pyeasyphd-0.2.6 → pyeasyphd-0.2.10}/pyeasyphd/data/Templates/CSL/apa.csl +0 -0
  14. {pyeasyphd-0.2.6 → pyeasyphd-0.2.10}/pyeasyphd/data/Templates/CSL/ieee.csl +0 -0
  15. {pyeasyphd-0.2.6 → pyeasyphd-0.2.10}/pyeasyphd/data/Templates/TEX/Article.tex +0 -0
  16. {pyeasyphd-0.2.6 → pyeasyphd-0.2.10}/pyeasyphd/data/Templates/TEX/Article_Header.tex +0 -0
  17. {pyeasyphd-0.2.6 → pyeasyphd-0.2.10}/pyeasyphd/data/Templates/TEX/Article_Tail.tex +0 -0
  18. {pyeasyphd-0.2.6 → pyeasyphd-0.2.10}/pyeasyphd/data/Templates/TEX/Beamer_Header.tex +0 -0
  19. {pyeasyphd-0.2.6 → pyeasyphd-0.2.10}/pyeasyphd/data/Templates/TEX/Beamer_Tail.tex +0 -0
  20. {pyeasyphd-0.2.6 → pyeasyphd-0.2.10}/pyeasyphd/data/Templates/TEX/Style.tex +0 -0
  21. {pyeasyphd-0.2.6 → pyeasyphd-0.2.10}/pyeasyphd/data/Templates/TEX/TEVC_Header.tex +0 -0
  22. {pyeasyphd-0.2.6 → pyeasyphd-0.2.10}/pyeasyphd/data/Templates/TEX/TEVC_Tail.tex +0 -0
  23. {pyeasyphd-0.2.6 → pyeasyphd-0.2.10}/pyeasyphd/data/Templates/TEX/eisvogel.beamer +0 -0
  24. {pyeasyphd-0.2.6 → pyeasyphd-0.2.10}/pyeasyphd/data/Templates/TEX/eisvogel.latex +0 -0
  25. {pyeasyphd-0.2.6 → pyeasyphd-0.2.10}/pyeasyphd/data/Templates/TEX/eisvogel.tex +0 -0
  26. {pyeasyphd-0.2.6 → pyeasyphd-0.2.10}/pyeasyphd/data/Templates/TEX/math.tex +0 -0
  27. {pyeasyphd-0.2.6 → pyeasyphd-0.2.10}/pyeasyphd/data/Templates/TEX/math_commands.tex +0 -0
  28. {pyeasyphd-0.2.6 → pyeasyphd-0.2.10}/pyeasyphd/main/__init__.py +0 -0
  29. {pyeasyphd-0.2.6 → pyeasyphd-0.2.10}/pyeasyphd/main/basic_input.py +0 -0
  30. {pyeasyphd-0.2.6 → pyeasyphd-0.2.10}/pyeasyphd/main/python_run_tex.py +0 -0
  31. {pyeasyphd-0.2.6 → pyeasyphd-0.2.10}/pyeasyphd/pyeasyphd.py +0 -0
  32. {pyeasyphd-0.2.6 → pyeasyphd-0.2.10}/pyeasyphd/pyeasyphd.sublime-syntax +0 -0
  33. {pyeasyphd-0.2.6 → pyeasyphd-0.2.10}/pyeasyphd/tools/__init__.py +0 -0
  34. {pyeasyphd-0.2.6 → pyeasyphd-0.2.10}/pyeasyphd/tools/generate/generate_from_bibs.py +0 -0
  35. {pyeasyphd-0.2.6 → pyeasyphd-0.2.10}/pyeasyphd/tools/generate/generate_html.py +0 -0
  36. {pyeasyphd-0.2.6 → pyeasyphd-0.2.10}/pyeasyphd/tools/generate/generate_library.py +0 -0
  37. {pyeasyphd-0.2.6 → pyeasyphd-0.2.10}/pyeasyphd/tools/generate/generate_links.py +0 -0
  38. {pyeasyphd-0.2.6 → pyeasyphd-0.2.10}/pyeasyphd/tools/py_run_bib_md_tex.py +0 -0
  39. {pyeasyphd-0.2.6 → pyeasyphd-0.2.10}/pyeasyphd/tools/search/data.py +0 -0
  40. {pyeasyphd-0.2.6 → pyeasyphd-0.2.10}/pyeasyphd/tools/search/search_base.py +0 -0
  41. {pyeasyphd-0.2.6 → pyeasyphd-0.2.10}/pyeasyphd/tools/search/search_core.py +0 -0
  42. {pyeasyphd-0.2.6 → pyeasyphd-0.2.10}/pyeasyphd/tools/search/search_keywords.py +0 -0
  43. {pyeasyphd-0.2.6 → pyeasyphd-0.2.10}/pyeasyphd/tools/search/search_writers.py +0 -0
  44. {pyeasyphd-0.2.6 → pyeasyphd-0.2.10}/pyeasyphd/tools/search/utils.py +0 -0
  45. {pyeasyphd-0.2.6 → pyeasyphd-0.2.10}/pyeasyphd/utils/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyeasyphd
3
- Version: 0.2.6
3
+ Version: 0.2.10
4
4
  Summary: pyeasyphd
5
5
  License: GPL-3.0-or-later
6
6
  License-File: LICENSE
@@ -16,8 +16,8 @@ Classifier: Programming Language :: Python :: 3.12
16
16
  Classifier: Programming Language :: Python :: 3.13
17
17
  Classifier: Programming Language :: Python :: 3.14
18
18
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
19
- Requires-Dist: pyadvtools (>=0.2.2,<0.3.0)
20
- Requires-Dist: pybibtexer (>=0.2.0,<0.3.0)
19
+ Requires-Dist: pyadvtools (>=0.2.4,<0.3.0)
20
+ Requires-Dist: pybibtexer (>=0.2.1,<0.3.0)
21
21
  Project-URL: Documentation, https://github.com/Easy-PhD/pyeasyphd
22
22
  Project-URL: Homepage, https://github.com/Easy-PhD/pyeasyphd
23
23
  Project-URL: Repository, https://github.com/Easy-PhD/pyeasyphd
@@ -31,6 +31,10 @@ class PandocMdTo(BasicInput):
31
31
  google_connected_paper_scite (bool): Whether to use Google connected paper scite. Defaults to True.
32
32
  display_one_line_reference_note (bool): Whether to display one line reference note. Defaults to False.
33
33
  cite_flag_in_tex (str): Citation flag in LaTeX. Defaults to "cite".
34
+ add_url_for_basic_dict (bool): Whether to add url for items in basic dict. Defualts to True.
35
+ add_anchor_for_basic_dict (bool): Whether to add anchor for items in basic dict. Defaults to False.
36
+ add_anchor_for_beauty_dict (bool): Whether to add anchor for items in beauty dict. Defaults to False.
37
+ add_anchor_for_complex_dict (bool): Whether to add anchor for items in complex dict. Defaults to False.
34
38
  """
35
39
 
36
40
  def __init__(self, options: dict) -> None:
@@ -52,6 +56,11 @@ class PandocMdTo(BasicInput):
52
56
  # tex
53
57
  self.cite_flag_in_tex: str = options.get("cite_flag_in_tex", "cite")
54
58
 
59
+ self.add_url_for_basic_dict: bool = options.get("add_url_for_basic_dict", True)
60
+ self.add_anchor_for_basic_dict: bool = options.get("add_anchor_for_basic_dict", False)
61
+ self.add_anchor_for_beauty_dict: bool = options.get("add_anchor_for_beauty_dict", False)
62
+ self.add_anchor_for_complex_dict: bool = options.get("add_anchor_for_complex_dict", False)
63
+
55
64
  def pandoc_md_to_md(
56
65
  self, path_bib: str, path_md_one: str, path_md_two: str, name_md_one: Optional[str], name_md_two: Optional[str]
57
66
  ) -> List[str]:
@@ -311,9 +320,18 @@ class PandocMdTo(BasicInput):
311
320
  if (not self.google_connected_paper_scite) and aa:
312
321
  bb = [f"([www]({aa[0].strip()}))\n"]
313
322
 
314
- a.extend(aa)
323
+ # add url
324
+ if self.add_url_for_basic_dict:
325
+ a.extend(aa)
326
+
315
327
  b.extend(bb)
316
328
 
329
+ # add anchor
330
+ if self.add_anchor_for_basic_dict:
331
+ a = [f'<a id="{k.lower()}"></a>'] + a
332
+ if self.add_anchor_for_beauty_dict or self.add_anchor_for_complex_dict:
333
+ b = [f'<a id="{k.lower()}"></a>'] + b
334
+
317
335
  if self.display_one_line_reference_note:
318
336
  a = ["".join(a).replace("\n", " ").strip() + "\n"]
319
337
  b = ["".join(b).replace("\n", " ").strip() + "\n"]
@@ -13,6 +13,35 @@ from .basic_input import BasicInput
13
13
  from .pandoc_md_to import PandocMdTo
14
14
 
15
15
 
16
+ def batch_convert_citations(text):
17
+ """
18
+ Process all citations in the text, including multiple citations in one bracket.
19
+
20
+ Example: [@ref1; @ref2] -> <sup>[@ref1](#ref1)</sup><sup>[@ref2](#ref2)</sup>
21
+ """
22
+ # Match all citation patterns within square brackets
23
+ pattern = r'\[([^]]+)\]'
24
+
25
+ def process_citation(match):
26
+ citations = match.group(1)
27
+ # Split multiple citations (support semicolon or comma separation)
28
+ citation_list = re.split(r'[;,]', citations)
29
+
30
+ result = []
31
+ for citation in citation_list:
32
+ citation = citation.strip()
33
+ if citation.startswith('@'):
34
+ cite_id = citation[1:] # Remove the @ symbol
35
+ result.append(f'[{citation}](#{cite_id.lower()})')
36
+ else:
37
+ # Keep non-citation content in original format
38
+ result.append(f'[{citation}]')
39
+
40
+ return ''.join(result)
41
+
42
+ return re.sub(pattern, process_citation, text)
43
+
44
+
16
45
  class PythonRunMd(BasicInput):
17
46
  """Python markdown processing class.
18
47
 
@@ -26,6 +55,7 @@ class PythonRunMd(BasicInput):
26
55
  replace_cite_to_fullcite_in_md (bool): Whether to replace citations with full citations in markdown. Defaults to False.
27
56
  replace_by_basic_beauty_complex_in_md (str): Replace by basic, beauty, or complex format. Defaults to "beauty".
28
57
  display_basic_beauty_complex_references_in_md (str): Display basic, beauty, or complex references. Defaults to "beauty".
58
+ add_anchor_in_md (bool): Whether add anchor in markdown. Defaults to False.
29
59
  """
30
60
 
31
61
  def __init__(self, options: Dict[str, Any]) -> None:
@@ -46,6 +76,7 @@ class PythonRunMd(BasicInput):
46
76
  self.display_basic_beauty_complex_references_in_md: str = options.get(
47
77
  "display_basic_beauty_complex_references_in_md", "beauty"
48
78
  )
79
+ self.add_anchor_in_md: bool = options.get("add_anchor_in_md", False)
49
80
 
50
81
  # for md
51
82
  self._pandoc_md_to = PandocMdTo(self.options)
@@ -175,6 +206,9 @@ class PythonRunMd(BasicInput):
175
206
  continue
176
207
 
177
208
  content[i] = content[i].replace(mch.group(), mch.group(1) + "[" + mch.group(2) + "]")
209
+ # add anchor
210
+ if self.add_anchor_in_md:
211
+ content = [batch_convert_citations(line) for line in content]
178
212
  n2 = "2_generate" + ".md"
179
213
  write_list(content, n2, "w", path_temp)
180
214
 
@@ -9,6 +9,14 @@
9
9
  "display_one_line_reference_note": false,
10
10
  // "fullcite", "cite"
11
11
  "cite_flag_in_tex": "cite",
12
+ // true, false
13
+ "add_url_for_basic_dict": true,
14
+ // true, false
15
+ "add_anchor_for_basic_dict": false,
16
+ // true, false
17
+ "add_anchor_for_beauty_dict": false,
18
+ // true, false
19
+ "add_anchor_for_complex_dict": false,
12
20
 
13
21
  // for md file
14
22
  // pyeasyphd/main/python_run_md.py
@@ -26,6 +34,8 @@
26
34
  "replace_by_basic_beauty_complex_in_md": "beauty",
27
35
  // basic, beauty, complex
28
36
  "display_basic_beauty_complex_references_in_md": "beauty",
37
+ // true, false
38
+ "add_anchor_in_md": false,
29
39
 
30
40
  // for tex file
31
41
  // pyeasyphd/main/python_run_tex.py
@@ -36,7 +36,7 @@ def run_article_md_daily_notes(
36
36
  # bib options
37
37
  "abbr_index_article_for_abbr": 1, # 0, 1, 2
38
38
  "abbr_index_inproceedings_for_abbr": 2, # 0, 1, 2
39
- "add_link_to_fields_for_abbr": None, # None, or ["title", "journal", "booktitle"]
39
+ "add_link_to_fields_for_abbr": ["title"], # None, or ["title", "journal", "booktitle"]
40
40
  "maximum_authors_for_abbr": 0, # 0, 1, 2, ...
41
41
  "add_index_to_entries": False,
42
42
  "bib_for_abbr_name": "abbr.bib",
@@ -62,6 +62,11 @@ def run_article_md_daily_notes(
62
62
  "generate_tex": False,
63
63
 
64
64
  # md options
65
+ "add_url_for_basic_dict": False, # default is True
66
+ "add_anchor_for_basic_dict": False, # default is False
67
+ "add_anchor_for_beauty_dict": True, # default is False
68
+ "add_anchor_for_complex_dict": False, # default is False
69
+
65
70
  "final_output_main_md_name": "main.md",
66
71
  "delete_temp_generate_md": True,
67
72
  "add_reference_in_md": True,
@@ -69,6 +74,7 @@ def run_article_md_daily_notes(
69
74
  "replace_cite_to_fullcite_in_md": True,
70
75
  "replace_by_basic_beauty_complex_in_md": "basic",
71
76
  "display_basic_beauty_complex_references_in_md": "beauty",
77
+ "add_anchor_in_md": True, # default is False
72
78
 
73
79
  "md_folder_name": "mds", # "" or "md" or "main"
74
80
  "delete_original_md_in_output_folder": True, # False
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "pyeasyphd"
3
- version = "0.2.6"
3
+ version = "0.2.10"
4
4
  description = "pyeasyphd"
5
5
  license = "GPL-3.0-or-later"
6
6
  authors = ["NextAI <nextartifintell@gmail.com>"]
@@ -14,8 +14,8 @@ classifiers = ["Topic :: Software Development :: Libraries :: Python Modules"]
14
14
 
15
15
  [tool.poetry.dependencies]
16
16
  python = ">=3.12"
17
- pyadvtools = "^0.2.2"
18
- pybibtexer = "^0.2.0"
17
+ pyadvtools = "^0.2.4"
18
+ pybibtexer = "^0.2.1"
19
19
 
20
20
  [tool.poetry.group.dev.dependencies]
21
21
  mypy = "^1.18.1"
File without changes
File without changes