def test_new_checkbox_checked_list(self): md_file = MdUtils(file_name="Test_file", title="") md_file.new_checkbox_list(self.complex_items, checked=True) md_file.create_md_file() self.assertEqual(self.expected_list.replace('-', '- [x]'), MarkDownFile.read_file('Test_file.md'))
def onboard(self, args): if hasattr(args, 'checklist'): mdFile = MdUtils(file_name='Example_Markdown', title='Markdown File Example') items = ["engineering handbook", "complete corporate training"] mdFile.new_checkbox_list(items) mdFile.create_md_file()
mdFile.new_paragraph("Moreover, you can add mixed list, for example: ") items = ["Item 1", "Item 2", ["1. Item 2.1", "2. Item 2.2"], "Item 3"] mdFile.insert_code(f'items = {items}\n' f'mdFile.new_list(items)') mdFile.new_list(items) mdFile.new_paragraph( "Maybe you want to replace the default hyphen ``-`` by a ``+`` or ``*`` then you can do: " "``mdFile.new_list(items, marked_with='*')``.") # *********************************************** Checkbox Lists ***************************************************** mdFile.new_header(3, "Create checkbox lists") mdFile.new_paragraph( "For creating checkbox lists you can use ``mdFile.new_checkbox_list(items)``." ) items = ["Item 1", "Item 2", ["Item 2.1", "Item 2.2"], "Item 3"] mdFile.new_checkbox_list(items) mdFile.new_paragraph( "If you want to check all of them you can do: ``mdFile.new_checkbox_list(items, checked=True)``" ) mdFile.new_checkbox_list(items, checked=True) mdFile.new_paragraph( "Or maybe you only want to check some of them, then you can add an ``x`` before each item that " "you want to check: ") items = ["Item 1", "Item 2", ["Item 2.1", "x Item 2.2"], "x Item 3"] mdFile.insert_code(f'{items}\n' 'mdFile.new_checkbox_list(items)') mdFile.new_checkbox_list(items) # ******************************************************************************************************************** # ************************************************** Add Images ******************************************************