Changeset e88bb78 in sasmodels
- Timestamp:
- Dec 1, 2015 12:40:17 PM (9 years ago)
- Branches:
- master, core_shell_microgels, costrafo411, magnetic_model, release_v0.94, release_v0.95, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- 7bb290c
- Parents:
- d18f8a8
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/generate.py
reb69cce re88bb78 203 203 splitext 204 204 import re 205 import string 205 206 206 207 import numpy as np … … 605 606 return source, info 606 607 608 section_marker = re.compile(r'\A(?P<first>[%s])(?P=first)*\Z' 609 %re.escape(string.punctuation)) 610 def _convert_section_titles_to_boldface(lines): 611 prior = None 612 for line in lines: 613 if prior is None: 614 prior = line 615 elif section_marker.match(line): 616 if len(line) >= len(prior): 617 yield "".join( ("**",prior,"**") ) 618 prior = None 619 else: 620 yield prior 621 prior = line 622 else: 623 yield prior 624 prior = line 625 if prior is not None: 626 yield prior 627 628 def convert_section_titles_to_boldface(string): 629 return "\n".join(_convert_section_titles_to_boldface(string.split('\n'))) 630 607 631 def doc(kernel_module): 608 632 """ … … 613 637 info = make_info(kernel_module) 614 638 is_Sq = ("structure-factor" in info['category']) 639 #docs = kernel_module.__doc__ 640 docs = convert_section_titles_to_boldface(kernel_module.__doc__) 615 641 subst = dict(id=info['id'].replace('_', '-'), 616 642 name=info['name'], … … 618 644 parameters=make_partable(info['parameters']), 619 645 returns=Sq_units if is_Sq else Iq_units, 620 docs= kernel_module.__doc__)646 docs=docs) 621 647 return DOC_HEADER % subst 622 648
Note: See TracChangeset
for help on using the changeset viewer.