code2docs 0.0.1-dev.3 copy "code2docs: ^0.0.1-dev.3" to clipboard
code2docs: ^0.0.1-dev.3 copied to clipboard

A library to generate samples from source code

example/code2docs_example.dart

import 'package:code2docs/code2docs.dart';

void main() {
  final generator = SourceCodeSampleToMarkdown(language: 'dart');

  final markdown = generator.generate(_sourceCode);

  print(markdown);
}

final _sourceCode =
    """
// TITLE: Creating a test
// STEPS:
// 1: Import the test package.
// 2: Create the main function.
// 3: Create a test group.
// 4: Create a test method.
//>step:1
import 'package:test/test.dart';
//<step:1
//>step:2
  void main() {
    //>step:3 Add this to the main function.
    group('my test group', () {
      //>step:4 Add this inside the test group.
      test('my test method', () {

      });
      //<step:4
    });
    //<step:3
  }
//<step:2""";
0
likes
135
points
47
downloads

Publisher

unverified uploader

Weekly Downloads

A library to generate samples from source code

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

args, collection, path

More

Packages that depend on code2docs