<jupyter_start><jupyter_text>print daily message<jupyter_code>day_info = {"day":u"1", "title":u"영광과 흑암", "song":u"하나님은 우리 아버지", "prayer":u"", "summary":u"", \
            "verses": [u"창1:3", u"창1:14", u"창1:26,28,29", u"창2:19", u"창2:9", u"창2:17", u"창3:6-7", \
              u"유1:6", u"벧후2:4", u"창3:17-18", u"왕하6:17", u"행26:18", u"롬1:19-20", u"요12:46", \
              u"골1:13", u"단2:22", u"요일5:19"]}
day_info["day"]
def make_mdpage(bible, day_info, save=False):
    """ print all verses in list using markdown format """
    
    # check day_info.yml file
    if isinstance(day_info, str):
        try:
            with open(day_info, "r") as f:
                day_info = yaml.load(f, yaml.BaseLoader)
        except:
            print("... file: {} parser error!".format(day_info))
            return 0
        
    bible_version = ""
    # check bible version
    if isinstance(bible, str):
        try:
            bible_version = "-" + bible
            bible = kbible.read_full_bible(bible)
        except:
            print("... read error: {}".format(bible_version))
            return 0
    
    msg = "# {}일차 - {}\n\n".format(day_info["day"],day_info["title"])
    msg = msg + "찬양 : {}\n\n".format(day_info["song"])
    msg = msg + "기도 : {}\n\n".format(day_info["prayer"])
    msg = msg + "요약 : {}\n\n".format(day_info["summary"])
    msg = msg + "성경 버전 : {}\n\n".format(bible_version[1:])
    
    for v in day_info["verses"]:
        msg = msg + '- {}\n\n'.format(kbible.extract_bystr(bible, v, form="md"))

    msg = msg + "### info\n\n"
    msg = msg + "- 성경 구절 갯수 : {}".format(len(day_info["verses"]))
    
    if save:
        filename = 'mpages/day{}-{}{}.md'.format(day_info["day"], day_info["title"].replace(" ", ""), bible_version)
        with open(filename, "w") as f:
            f.write(msg)
        print('... save to {}'.format(filename))
            
    return msg
print(make_mdpage("현대인의성경", "day1.yaml", save=True))
#kbible.find_id(bible, book="롬", chapter=1)<jupyter_output><empty_output><jupyter_text>daily info file<jupyter_code>import yaml
print(yaml.dump(day_info, allow_unicode=True))
with open('day1.yaml', "w") as f:
    yaml.dump(day_info, f, allow_unicode=True)
yaml.load?<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.20124944221329763, 'fraction_numerical': 0.0285586791610888, 'mean_word_length': 2.8, 'pattern_counts': {'":': 6, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '2070', 'license': 'Apache-2.0', 'n_tokens_mistral': 948, 'n_tokens_neox': 955, 'n_words': 159, 'path': 'dev/make_markdown.ipynb', 'repo_name': 'sungcheolkim78/py_kbible', 'size': '2241'}